@@ -3,7 +3,113 @@ id: install
33title : Installation
44---
55
6- @todo
6+ Depending on how you want to start with _ Reason React Native_ , you have
7+ different options to install it:
8+
9+ - [ Create a new project with _ Reason React Native_ ] ( #create-a-new-project-with-reason-react-native )
10+ - [ Add _ Reason React Native_ to an existing project] ( #add-reason-react-native-to-an-existing-project )
11+ - [ Migrating from ` bs-react-native ` to _ Reason React Native_ ] ( /reason-react-native/en/docs/migration/jsx3/ )
12+
13+ All options will basically help you to have :
14+
15+ - [ BuckleScript] ( https://bucklescript.github.io/ ) (` bs-platform ` - includes
16+ [ ReasonML] ( https://reasonml.github.io ) !)
17+ - [ Reason React] ( https://reasonml.github.io/reason-react/ ) (` reason-react ` )
18+ - _ Reason React Native_ (` reason-react-native ` )
19+
20+ Below we assume you are already familiar with React Native. If you are new to
21+ React Native, please have a quick look to
22+ [ React Native Getting Started documentation] ( https://facebook.github.io/react-native/docs/getting-started.html )
23+ in order to get the minimal requirements.
24+
25+ ## Create a new project with _ Reason React Native_
26+
27+ React Native allows to create new project from a template, so we made one. By
28+ choosing this option you will get an hello world project that will already have
29+ all the requirements included.
30+
31+ ``` console
32+ react-native init MyApp --template reason
33+ ```
34+
35+ 💖 Now that you project is setup, you can just check
36+ [ how to use _ Reason React Native_ ] ( #using-reason-react-native ) right away!
37+
38+ ---
39+
40+ ⚠️ We don't provide yet instructions for _ Expo_ users. _ If you are familiar with
41+ Expo, feel free to open
42+ [ an issue] ( https://github.com/reasonml-community/reason-react-native/issues/new?title=Expo+template )
43+ so we can discuss about that_ .
44+
45+ ## Add _ Reason React Native_ to an existing project
46+
47+ If you already have an existing project, it's really fast to get all the thing
48+ you need to start using Reason React Native right away!
49+
50+ Got into your project root & then install the requirements
51+
52+ ``` console
53+ yarn add bs-platform --dev
54+ yarn add reason-react reason-react-native
55+ ```
56+
57+ Then create a file named ` bsconfig.json ` at the same level at your
58+ ` package.json ` with the following content
59+
60+ ``` json
61+ {
62+ "name" : " my-reason-react-native-app" ,
63+ "refmt" : 3 ,
64+ "reason" : {
65+ "react-jsx" : 3
66+ },
67+ "package-specs" : {
68+ "module" : " es6" ,
69+ "in-source" : true
70+ },
71+ "suffix" : " .bs.js" ,
72+ "sources" : [
73+ {
74+ "dir" : " src" ,
75+ "subdirs" : true
76+ }
77+ ],
78+ "bs-dependencies" : [" reason-react" , " reason-react-native" ]
79+ }
80+ ```
81+
82+ 👀 _ For details about this file, please refer to
83+ [ BuckleScript Configuration documentation] ( https://bucklescript.github.io/docs/en/build-configuration ) ._
84+
85+ When it's done, you are ready to use Reason React Native !
86+
87+ ---
88+
89+ ## Using Reason React Native
90+
91+ @todo move here
92+ [ what's in the template readme] ( https://github.com/reasonml-community/reason-react-native/tree/master/react-native-template-reason#react-native-helloworld )
93+
94+ ### Using JavaScript components from Reason
95+
96+ @todo check out
97+ [ Reason React interop page] ( https://reasonml.github.io/reason-react/docs/en/components#interop ) .
98+
99+ You can also browse the source of
100+ [ reason-react-native] ( https://github.com/reasonml-community/reason-react-native/tree/master/reason-react-native/src )
101+ because that's exactly what this project is doing!
102+
103+ ### Using Reason React Native components from JavaScript
104+
105+ @todo Meanwhile, check out
106+ [ Reason React interop page] ( https://reasonml.github.io/reason-react/docs/en/components#interop )
107+
108+ ---
109+
110+ 👉 At this step, you should check our in-depth
111+ [ Example] ( /reason-react-native/en/docs/example/ ) or our
112+ [ Cheatsheet] ( /reason-react-native/en/docs/cheatsheet/ )
7113
8114---
9115
0 commit comments