This was done using these dependnecies:
"devDependencies": {
"bs-platform": "^8.2.0",
"husky": "^4.0.0",
"lint-staged": "^10.0.0",
"npmpub": "^5.0.0",
"prettier": "^2.0.0",
"reason-react": "^0.9.1",
"reason-react-native": "^0.64.0"
},
The reason for these older/deprecated deps is this port is being done for compatibility with an older project,
and also because it's not currently possible to do this easily with bs-platform combined with the newer version
of reason-react
, which is built with dune
.
There is also not a newer version of reason-react-native
- the newer version of this is now in rescript
.
- Use
npm install --legacy-peer-deps
to avoid an incompatibility issue withbs-platform
/reason-react
/reason-react-native
- Need to set up an ocaml
4.06.1
environment (can be done withopam switch create 4.06.1
) - LSP tools should work with
opam install ocaml-lsp-server dot-merlin-reader
- not sure what else needs to be done, as mine didn't require additional setup - Use these commands for building/etc.:
npm run clean
npm run build
npm run watch
The code is ported and compiling, and there is an example that appears to be working.
There are a couple interesting things going on with the Interop
module and some module unpacking in a few of the modules.
The example/
directory was based on this version of an old reason-react-native
template: https://github.com/rescript-react-native/template/tree/0.63.0
The generator tool didn't work with this version, so I just copied the files from the template by hand.
The files from src/
need to be copied into the example/src/vendor
folder for this example project to work.
> cd example && yarn reset-vendor
There is also a problem you have to manually fix with the older version of react-native Yoga dependency and newer Xcode:
> cd example/node_modules/react-native/ReactCommon/yoga/yoga/
> $EDITOR Yoga.cpp
# Change line 2283 single pipe `|` to `||`
> cd example
> yarn install
> yarn react-native start --reset-cache # In one terminal
> yarn run ios # In one terminal
# :pray:
ReScript bindings for
react-navigation
.
Exposed as ReactNavigation
module.
rescript-react-navigation
X.y.* means it's compatible with react-navigation
X.y.*
When
react-navigation
is
properly installed & configured by following their installation instructions,
you can install the bindings:
npm install rescript-react-navigation
# or
yarn add rescript-react-navigation
rescript-react-navigation
should be added to bs-dependencies
in your
bsconfig.json
:
{
//...
"bs-dependencies": [
"@rescript/react",
"rescript-react-native",
// ...
+ "rescript-react-navigation"
],
//...
}
See <./src/Example.re>
Check the changelog for more informations about recent releases.
Read the contribution guidelines before contributing.
We want this community to be friendly and respectful to each other. Please read our full code of conduct so that you can understand what actions will and will not be tolerated.