Giter Site home page Giter Site logo

Comments (3)

cipolleschi avatar cipolleschi commented on September 27, 2024

@prashantpadhariya1137 what are you trying to do here?
Are you creating a new react native app or are you trying to integrate React native in an existing app?

In both cases, what you are doing is not the right process.
To create a new app, please run:

// Using Expo
npx create-expo-app@latest

// Using the community CLI
npx @react-native-community/cli@latest init <Name of your project> --version latest

If you want to integrate React native in an existing app, we have some docs here but they might be outdated.

from react-native.

prashantpadhariya1137 avatar prashantpadhariya1137 commented on September 27, 2024

@cipolleschi

I'm trying to create android library using react-native project and call that library in another android native project.

  1. Created .aar file using react-native project and call react-native functions from android native.

like this

public static void sendEvent(String eventName, @javax.annotation.Nullable Object params) {
android.util.Log.d("TAG", "sendEvent: 123 R"+reactContext);

    reactContext
            .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
            .emit(eventName, params);
}

send event like this .
  1. Import that .aar file in to another Android native project and call this sendEvent() method but reactcontext is getting null in my project so i need reactcontext value in Android native project.

Let me know how to get reactcontext value in android native project.

from react-native.

cipolleschi avatar cipolleschi commented on September 27, 2024

@prashantpadhariya1137 I understand.

This is not the right way to create a library for react-native: there is more boilerplate and setup needed for that.
Please follow the guide here to get started

from react-native.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.