Add flight specific entry point for react package (#20304)
This configures the Flight fixture to use the "react-server" environment. This allows the package.json exports field to specify a different resolution in this environment. I use this in the "react" package to resolve to a new bundle that excludes the Hooks that aren't relevant in this environment like useState and useEffect. This allows us to error early if these names are imported. If we actually published ESM, it would we a static error. Now it's a runtime error. You can test this by importing useState in Container.js which is used by the client and server.
S
Sebastian Markbåge committed
d93b58a5e38cf06998da628932029291cc605c2d
Parent: 89d4fe1
Committed by GitHub <noreply@github.com>
on 11/20/2020, 4:47:13 PM