create-react-native-library
Version:
CLI to scaffold React Native libraries
64 lines (39 loc) • 1.15 kB
Markdown
<%- project.description %>
<% if (project.moduleConfig === 'nitro-modules') { -%>
```sh
npm install <%- project.slug %> react-native-nitro-modules
> `react-native-nitro-modules` is required as this library relies on [Nitro Modules](https://nitro.margelo.com/).
```
<% } else { -%>
```sh
npm install <%- project.slug %>
```
<% } -%>
<% if (project.viewConfig !== null) { -%>
```js
import { <%- project.name -%>View } from "<%- project.slug -%>";
// ...
<<%- project.name -%>View color="tomato" />
```
<% } else if (project.moduleConfig === 'nitro-modules' || project.moduleConfig === 'turbo-modules') { -%>
```js
import { multiply } from '<%- project.slug -%>';
// ...
const result = multiply(3, 7);
```
<% } else { -%>
```js
import { multiply } from '<%- project.slug -%>';
// ...
const result = await multiply(3, 7);
```
<% } -%>
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
MIT
---
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)