Skip to content

Releases: pmndrs/react-three-rapier

@react-three/[email protected]

21 May 18:20
062b5c4
Compare
Choose a tag to compare

Patch Changes

@react-three/[email protected]

21 May 14:17
057dd8d
Compare
Choose a tag to compare
Pre-release

Major Changes

  • 6c764cc: Remove WorldApi, replace with singleton instance proxy (@wiledal)

    BREAKING CHANGE: The WorldApi has been removed. Instead, you can now import the singleton instance of the world from @react-three/rapier. This is a breaking change, but it should be easy to migrate to.

    Before:

    import { useRapier } from "@react-three/rapier";
    
    const Component = () => {
      const { world } = useRapier();
    
      useEffect(() => {
        // Access to the WorldApi (limited)
        world.bodies.forEach(() => {
          // Do something
        });
    
        // Access the raw Rapier World instance
        const rawWorldInstance = world.raw();
        rawWorldInstance.raw().setGravity(new Vector3(0, -9.81, 0));
      }, []);
    };

    Now:

    import { useRapier } from "@react-three/rapier";
    
    const Component = () => {
      const { world } = useRapier();
    
      useEffect(() => {
        // Access the Rapier World instance directly
        world.bodies.forEach(() => {
          // Do something
        });
        world.setGravity(new Vector3(0, -9.81, 0));
      }, []);
    };

    Note: it is best to avoid accessing properties and methods on the world outside of useEffect, or useLayoutEffect in order for the world to be properly synchronized with the React component lifecycle.

    // bad
    const Component = () => {
      const {world} = useRapier()
    
      world.setGravity(...)
    
      return null
    }
    
    // good
    const Component = () => {
      const {world} = useRapier()
    
      useEffect(() => {
        world.setGravity(...)
      }, [])
    
      return null
    }

@react-three/[email protected]

21 May 14:17
057dd8d
Compare
Choose a tag to compare
Pre-release

Patch Changes

@react-three/[email protected]

17 May 09:25
acc27e2
Compare
Choose a tag to compare
Pre-release

Patch Changes

  • 3057f3c: Fix initiation to only happen in mount effects, never render, for increased stability (@wiledal)

@react-three/[email protected]

17 May 09:25
acc27e2
Compare
Choose a tag to compare
Pre-release

Patch Changes

@react-three/[email protected]

16 May 19:33
9621db9
Compare
Choose a tag to compare
Pre-release

Minor Changes

Patch Changes

  • c4d2446: Internal refactor regarding instances

@react-three/[email protected]

29 Apr 09:36
62791d8
Compare
Choose a tag to compare

Patch Changes

  • 35ee03b: Loosen peer deps in attempt to solve npm install conflicts

@react-three/[email protected]

29 Apr 09:36
62791d8
Compare
Choose a tag to compare

Patch Changes

@react-three/[email protected]

16 Apr 10:10
f6573db
Compare
Choose a tag to compare

⚠️ This update contains a few breaking changes. See migration guide: https://github.com/pmndrs/react-three-rapier/wiki/0.14.x-to-0.15.x-Migration-Guide

Minor Changes

  • 3d8f152: Removes the <Debug /> component, in favor of setting debug={true} on the <Physics /> component instead
  • 3d8f152: Move <Attractor /> to @react-three/rapier-addons

@react-three/[email protected]

16 Apr 10:10
f6573db
Compare
Choose a tag to compare

Major Changes

  • 3d8f152: Move <Attractor /> to @react-three/rapier-addons

Patch Changes