Skip to content

Instantly share code, notes, and snippets.

@mrmurphy
Created June 29, 2019 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrmurphy/8cde6163c301acfd92d60198eb7fcaef to your computer and use it in GitHub Desktop.
Save mrmurphy/8cde6163c301acfd92d60198eb7fcaef to your computer and use it in GitHub Desktop.
Bloom Built Upgrade from JSX 2 to JSX 3 (Reason React)
Alternative migration path for JSX 2 to JSX 3 Reason React
https://bloodyowl.github.io/blog/2019-04-19-an-alternative-migration-path-for-reason-react/
https://github.com/bloodyowl/reason-react-update
https://bloodyowl.github.io/blog/2019-01-24-orchestrating-requests-at-component-level/
This migration was really slick. We just ran it on the files we needed migrated (you can’t just pass files as args to the executable, you’ve got to pipe the names in)
find src -name "*.re" | yarn Upgrade
Or echo src/front/components/InstructionsComponent.re | yarn Upgrade
And then install the compat library and add it to the bsconfig.json.
yarn add reason-react-compat
In one instance we had to remove an unnecessary function call to React.Children.whatever that the compiler was failing on.
More details here:
https://reasonml-community.github.io/reason-react-native/en/docs/migration/jsx3/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment