React custom build
To benefit from some specific features hidden behind flags (such as suspense), we need to make our own build of React from the sources.
Make a custom React suspense build
As explained here:
Generate the packages
Clone the React repository.
First, open this file locally:
packages/shared/ReactFeatureFlags.js(make sure you didn't open a similarly named file!)
enableSuspense flag to
true and save the file.
Then build the packages:
cd /path/to/react yarn yarn build dom-client,core,react-cache,schedule --type=NODE
Copy the packages to your project
cp -a /path/to/react/build/node_modules/* /path/to/react-fiber-experiments/react-modules/
The modules in
react-modules are aliased, thanks to
react-app-rewired with which I overrode
Please update the
infos.json file with the exact hash of the git revision you used to make your React custom build.