Skip to content

0.14.x to 0.15.x Migration guide

Hugo Wiledal edited this page Feb 12, 2024 · 1 revision

New package!

A new package (@react-three/rapier-addons) has been introduced for keeping core functionality isolated from addons, leading to a smaller package size. It will be used as a collection for solutions to common problems, such as controllers and effectors.

In order to allow flexibility of the new package, some changes have been made to rt/rapier.

Debug changes

The <Debug /> component has been internalised and replaced by setting <Physics debug={true} />. This allows us to pass isDebug in the useRapier context.

Previously:

import { Physics, Debug } from '@react-three/rapier'

<Physics>
  <Debug />
  ...
</Physics>

Now:

import { Physics } from '@react-three/rapier'

<Physics debug>
 ...
</Physics>

Attractor has been moved to @react-three/rapier-addons

The first non-core part of rt/rapier has been moved to the new addons-package.
This reduces bundle size, and keeps things more organized.

Previously:

import { Physics, Attractor } from '@react-three/rapier'

<Physics>
  <Attractor />
</Physics>

Now:

import { Physics } from '@react-three/rapier'
import { Attractor } from '@react-three/rapier-addons'

<Physics>
  <Attractor />
</Physics>