The Bit development environment provides your components with the dev tooling and configuration required to run, build and test your components.
You can create a custom React env that extends Bit's base React env, to better control your configuration and tools.
In an existing workspace use the following command to create a custom React env:
Alternatively, if you do not have a workspace yet, create a workspace containing a custom env with the following command:
Your env will look similar to the following:
The new custom env contains templates for new components. Add them to your workspace by adding this snippet to workspace.jsonc
.
{ "teambit.generator/generator": { "envs": ["my-org.my-scope/my-custom-env"] } }
The Bit React env uses React 18. To update the React version, change the peers
entry in your env.jsonc.
To use React 17, it's recommended to start with Bit React 17 environment.
It comes with a workspace starter:
Or create
in an existing workspace: