react-native-component

Generate skeletons for react native components

Usage no npm install needed!

<script type="module">
  import reactNativeComponent from 'https://cdn.skypack.dev/react-native-component';
</script>

README

react-native-component

GitHub issues GitHub version MIT license

Generate skeletons for react native components

Note: this package assumes you use components with the following structure:

.
├── ComponentName
     ├── index.js
     ├── styles.js  

Installation

yarn global add react-native-component
or
npm install -g react-native-component

Usage

To create a component in the current directory

react-native-component -n <ComponentName>

To create a component in a specified path

react-native-component -n <ComponentName> -p <CustomPath>

To specify that the component should be stateless

react-native-component -n <ComponentName> -s

Example

  1. Creating a Login component

react-native-component -n Login

  1. Creating a stateless Button component in a specific path

react-native-component -n Button -p components/Common