-
Notifications
You must be signed in to change notification settings - Fork 70
0.14.x to 0.15.x Migration guide
Hugo Wiledal edited this page Feb 12, 2024
·
1 revision
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.
- See the new package: https://github.com/pmndrs/react-three-rapier/tree/main/packages/react-three-rapier-addons
In order to allow flexibility of the new package, some changes have been made to rt/rapier.
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>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>