# React-babylonjs v3

**URL:** <https://forum.babylonjs.com/t/react-babylonjs-v3/17350>\
**Category:** Demos and projects\
**Created:** [January 11, 2021, 6:07am UTC](https://forum.babylonjs.com/t/react-babylonjs-v3/17350 "2021-01-11T06:07:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![brianzinn](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/brianzinn/32/28013_2.png) [@brianzinn](https://forum.babylonjs.com/u/brianzinn)\
**Post date:** [January 11, 2021, 6:07am UTC](https://forum.babylonjs.com/t/react-babylonjs-v3/17350/1 "2021-01-11T06:07:41Z")

</div>

Well, it’s been over a year since `react-babylonjs` v2 came out. There have been ~30 releases and ~50 github issues closed in the meantime - also some incredible PRs from the community. It’s really the ideas from random people that keep pushing the project forward! There has been lots of new functionality: instancing (and instancedMesh), more complete babylon API support (and changes to support Babylon 4.2 and React 17), improved declarative support for textures, hooks for `AssetManager` and `SceneLoader` (need Suspense), `Cascaded Shadow Maps` (from Dennemark), properly support quaternions in renderer, assigning to multiple properties declaratively (ie: textures), lots of new hooks (and fixes) like `useHover`, `useHook`, effect layers, behaviors (from hookex), add observable to before/after scene render - to allow `PIXIjs` in back/foreground, allow registering dynamic property assignment for renderer (ie: assign “hot pink” as a `Color3` - see chromajs story), kebab property assignment (ie: `rotation-x` for external GUI library), various improvements to the code generation and many other changes.

Also hookex created a project that uses react-babylonjs to allow it to work with react-spring, which gives really nice animations and physics.

The primary reason though for a 3.0 release was to introduce 4 breaking changes:

1. `<model>` is replaced by `<Model>` (host element to component) and it must now be enclosed in a React Suspense block. The model supplies loading progress with a context, so the fallback component on Suspense can report progress.
2. Somewhere in v2 the `fromInstance` prop was introduced and the passed in instance would be automatically disposed (requiring a hack to patch the dispose method on the object otherwise). The new functionality is to not dispose and you can opt-in to dispose with `disposeInstanceOnUnmount`. ie:

```auto
<mesh name='box' fromInstance={mesh} rotation={props.rotation} disposeInstanceOnUnmount .../>

```

1. When you got a ref using the React `useRef` hook in v2 you needed to use the `hostInstance` to access the babylon.js object. I found a method on the reconciler that allowed me hide the metadata the reconciler is using and provide functionality using standard references.
2. Some hooks were renamed. ie: `useBabylonScene` is now just `useScene`, etc.

I also added some basic support in the Scene Explorer for showing the now hidden metadata from refs. To be able to show props not available on the babylonjs object (like shadow casting, nested property assigning, etc). I wanted, however, the properties read-only and that’s not supported for Custom Properties. I have a PR for the Scene Explorer to allow custom properties to be declared read-only if that seems like a useful addition then I can propose (it’s missing readonly slider and maybe others).

Upcoming goals are support for declarative NME and to revisit react-native support via Expo. React-native support was a goal after the 2.0 release, but was a really busy year and hoping to do that in earnest this year.

See you on the playground 🙂

[brianzinn/react-babylonjs (github.com)](https://github.com/brianzinn/react-babylonjs)

---

<div class="post-metadata">

**Author:** ![dennemark](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dennemark/32/10745_2.png) [@dennemark](https://forum.babylonjs.com/u/dennemark)\
**Post date:** [January 11, 2021, 9:52am UTC](https://forum.babylonjs.com/t/react-babylonjs-v3/17350/2 "2021-01-11T09:52:59Z")

</div>

Congrats to the release!  
I can only recommend react-babylonjs! Brian is doing a great job and if you are missing features, he is there to help you!

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [January 11, 2021, 11:09am UTC](https://forum.babylonjs.com/t/react-babylonjs-v3/17350/3 "2021-01-11T11:09:09Z")

</div>

Wow @brianzinn,

amazing work as always! Can’t wait to use the new version! I can promise it will happen VERY soon 🙂

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [January 11, 2021, 4:44pm UTC](https://forum.babylonjs.com/t/react-babylonjs-v3/17350/4 "2021-01-11T16:44:46Z")

</div>

Congrats buddy! this is so rad!

---

<div class="post-metadata">

**Author:** ![brianzinn](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/brianzinn/32/28013_2.png) [@brianzinn](https://forum.babylonjs.com/u/brianzinn)\
**Post date:** [November 19, 2021, 5:21pm UTC](https://forum.babylonjs.com/t/react-babylonjs-v3/17350/7 "2021-11-19T17:21:45Z")

</div>

> [@Necips](#):
>
> Do you know a simple, direct way to make all these things work?

Downgrade your node to LTS version (like 16.3.0) or change your package.json to:

```auto
"start": "react-scripts --openssl-legacy-provider start"

```

That’s a less secure SSL, but is fine for development purposes.

---

<div class="post-metadata">

**Author:** ![brianzinn](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/brianzinn/32/28013_2.png) [@brianzinn](https://forum.babylonjs.com/u/brianzinn)\
**Post date:** [November 19, 2021, 6:23pm UTC](https://forum.babylonjs.com/t/react-babylonjs-v3/17350/9 "2021-11-19T18:23:46Z")

</div>

after you downgrade node you need to delete your “node\_modules” directory and “npm install” again. There is a typescript template as well if you are working in typescript:

```bash
npx create-react-app your-app-name --template typescript

```
