Great that you consider to contribute to the Bucklescript bindings for React Native. Every contribution is greatly appreciated! There are many ways to contribute, besides implementing new features and fixing bugs, you can give advice in issues, create and improve documentation, etc.
You can find an overview of the implemented components and APIs here.
That's awesome!. If you have a specific one in mind go for it, otherwise just pick one of your choice. If you expect that it would take you a while (which is no problem) you can open a PR with your working progress to let everybody know you are working on it. To add component (or API) you should do the following steps:
- Implement your component in a file
myComponentRe.re
- Add an interface
myComponentRe.rei
and think about which things should be exposed. - Add your new component to
reactNative.re
following the existing components / APIs.
Some things to keep in mind:
- We strive for more heavy bindings, i.e. we try to hide things like
Js.t
objects, but sometimes this is not possible. - String enums, which are an argument to a function, are represented through polymorphic variants.
- You should format your code with
refmt
.
Well, that happens. But don't give up! Just join the Discord Server and ask your questions in #react or #bucklescript. Everybody is really welcoming and helpful!
git clone https://github.com/BuckleTypes/bs-react-native.git
cd react-native
npm install
Then build with npm start
.
You can generate an interface file (.rei
) with
./node_modules/bs-platform/bin/bsc.exe -pp 'refmt --print binary' -i -I lib/bs/src/ -I lib/bs/src/components -I ./node_modules/reason-react/lib/bs/src/ -impl /path/to/your/file.re
This generates the OCaml variant of the interface file. To obtain a reason interface you can copy it into Reason Tools or pipe it to refmt
with
refmt --parse ml --interface true
- Bucklescript Manual
- The React Native docs
- The TypeScript definitions are really useful if the docs aren't that clear about the signature of an API.