| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [View Raw Code] [Original HTTPS Page] |
| slug | install |
|---|---|
| title | Installation |
Depending on how you want to start with ReScript React Native, you have different options to install it:
All options will basically help you to have :
Below we assume you are already familiar with React Native. If you are new to React Native, please have a quick look to React Native Getting Started documentation in order to get the minimal requirements.
React Native allows to create new project from a template, so we made one. By choosing this option you will get an hello world project that will already have all the requirements included.
When you have correctly react-native-cli installed, you can run the following command:
npx @react-native-community/cli init --template @rescript-react-native/template MyApp
cd MyApp💖 Your project is setup, you can just check how to use ReScript React Native right away!
⚠️ We don't provide yet instructions for Expo users. If you are familiar with Expo, feel free to open an issue so we can discuss about that.
If you are an Expo user, just have a look at the instructions below when your Expo app is ready.
If you already have an existing project, it's really fast to get all the thing you need to start using ReScript React Native right away!
👉 You can decide to use ReScript React Native for certain components only as the compilation process generate normal JavaScript.
Go into your project root & then install the requirements:
npm install rescript --save-dev
npm install @rescript/react rescript-react-nativeThen create a file named bsconfig.json at the same level at your package.json with the following content
{
"name": "my-rescript-react-native-app",
"reason": { "react-jsx": 3 },
"package-specs": {
"module": "es6",
"in-source": true
},
"suffix": ".bs.js",
"sources": [
{
"dir": "src",
"subdirs": true
}
],
"bs-dependencies": ["@rescript/react", "rescript-react-native"]
}The main things you should notice here:
👀 For details about this file, please refer to ReScript Configuration documentation if needed.
When it's done, you are ready to use ReScript React Native !
We decided to try something simple for you:
⚛️ rescript-react-native 0.60.* means it should work with react-native ^0.60.0.
We keep patch number for bindings fixes. react-native patches should not affect our bindings. This means last digit don't need to match each others:
👉 In short: rescript-react-native 0.x.* means it should work with react-native@^0.x.*.
| Back | FazBrowse Home | New Git URL |