To get set up with the basic project structure for a native module we will use the community tool called create-react-native-library. You can go ahead further and dive deep into how that library works, but for our needs we will only execute the basic script:
npx create-react-native-library react-native-awesome-module
react-native-awesome-module is the name you would like for the new module. After doing this you will navigate into
react-native-awesome-module folder and bootstrap the example project by running:
When the bootstrap is done, you will be able to start the example app by executing one of the following commands:
# Android appyarn example android# iOS appyarn example ios
For a less opinionated setup, have a look at the third party tool create-react-native-module.