You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 10f3901
Browse filesBrowse the repository at this point in the historyBrowse files
@@ -129,17 +101,17 @@ Here are some commits that might help you
129
101
130
102
🙏 _Please do not hesitate to share your experience with the migration._ If the
131
103
source is open, post your commit here, it could help someone without you even
132
-
knowing 🤷♂️
104
+
knowing 🤷
133
105
134
-
## Need help to migrate?
106
+
## Need help to migrate?
135
107
136
108
If you struggle with it & have questions,
137
109
[reach us on our discord server](https://discord.gg/eaU3Z6Q)
138
110
139
111
---
140
112
141
-
**If you are reading this, you can assume you are done & ready to work on other
142
-
things, like feature & bugfix for your product.**
113
+
🎉 **If you are reading this, you can assume you are done & ready to work on
114
+
other things, like feature & bugfix for your product.**
143
115
144
116
---
145
117
@@ -148,47 +120,69 @@ things, like feature & bugfix for your product.**
148
120
You can do some easy stuff to cleanup your codebase now that everything is
149
121
working and that you are ready to use reason-react 0.7:
150
122
151
-
- Easy replacement
152
-
-`ReasonReact.string` => `React.string`
153
-
-`ReasonReact.array` => `React.array`
154
-
-`ReasonReact.null` => `React.null`
155
-
-`ReasonReact.reactElement` => `React.element`
156
-
- ...
157
-
- More tricky ones: you can probably remove lot of unecessary wrapping for
158
-
stateless component that don't use the lifecycle
159
-
```reason
160
-
ReactCompat.useRecordApi({
161
-
...component,
162
-
render: _self => {
163
-
```
164
-
Can be replaced with
165
-
```reason
166
-
({{
167
-
```
168
-
And
169
-
```reason
170
-
ReactCompat.useRecordApi({
171
-
...component,
172
-
render: _self =>
173
-
```
174
-
Can be replaced with
175
-
```reason
176
-
({
177
-
```
178
-
At this point, the 2 replacements above have generated syntax error, so you
179
-
should try to replace
180
-
```reason
181
-
,
182
-
});
183
-
```
184
-
with
185
-
```reason
123
+
### Easy replacement
124
+
125
+
-`ReasonReact.string` => `React.string`
126
+
-`ReasonReact.array` => `React.array`
127
+
-`ReasonReact.null` => `React.null`
128
+
-`ReasonReact.reactElement` => `React.element`
129
+
- ...
130
+
131
+
### More tricky ones
132
+
133
+
You can probably remove lot of unecessary wrapping for stateless component that
134
+
don't use the lifecycle
135
+
136
+
```reason
137
+
ReactCompat.useRecordApi({
138
+
...component,
139
+
render: _self => {
140
+
```
141
+
142
+
Can be replaced with
143
+
144
+
```reason
145
+
({{
146
+
147
+
```
148
+
149
+
And
150
+
151
+
```reason
152
+
ReactCompat.useRecordApi({
153
+
...component,
154
+
render: _self =>
155
+
```
156
+
157
+
Can be replaced with
158
+
159
+
```reason
160
+
({
161
+
```
162
+
163
+
At this point, the 2 replacements above have generated syntax error, so you
164
+
should try to replace
165
+
166
+
```reason
167
+
,
186
168
});
187
-
```
188
-
At this point, you should be able to drop some
189
-
`let component = ReasonReact.statelessComponent...` too, since some won't be
190
-
used anymore thanks to the last removal step we did.
169
+
```
170
+
171
+
with
172
+
173
+
```reason
174
+
});
175
+
176
+
```
177
+
178
+
At this point, you should be able to drop some
179
+
`let component = ReasonReact.statelessComponent...` too, since some won't be
180
+
used anymore thanks to the last removal step we did.
191
181
192
182
Now rely on refmt to get a cleaner code and you are good to go!
193
183
194
-
Do not hesitate to share more tips & tricks to ease the migration! Don't be shy!
184
+
---
185
+
186
+
Do not hesitate to share more tips & tricks to ease the migration!
187
+
188
+
[Don't be shy!](https://github.com/reasonml-community/reason-react-native/issues/new?title=JSX3+migration+trick&body=Hey%20I%20have%20a%20trick%20that%20I%20can%20share%20with%20you%20to%20ease%20jsx3%20migration%3A)
0 commit comments