Adding React
Installing bud.js dependencies
To get started with React, install the @roots/bud-react extension to your project along with a compatible compiler:
We recommend using @roots/bud-swc:
- npm
- Yarn
- pnpm
npm install @roots/bud-swc @roots/bud-typescript --save-dev
yarn add @roots/bud-swc @roots/bud-typescript --dev
pnpm add @roots/bud-swc @roots/bud-typescript --save-dev
If you need to further customize React for your application, reference the @roots/bud-react documentation.
Installing production dependencies
React requires installing react
and react-dom
as production dependencies.
We will try and resolve them for you but it is a good idea to install them as explicit dependencies:
- npm
- Yarn
- pnpm
npm install react react-dom --save
yarn add react react-dom
pnpm add react react-dom
Configuration
No configuration is required. If you need to customize the provided defaults refer to the @roots/bud-react documentation.