# Quick question on rendering multiple scenes on multiple canvases

**URL:** <https://forum.babylonjs.com/t/quick-question-on-rendering-multiple-scenes-on-multiple-canvases/35825>\
**Category:** Questions\
**Created:** [November 19, 2022, 4:51am UTC](https://forum.babylonjs.com/t/quick-question-on-rendering-multiple-scenes-on-multiple-canvases/35825 "2022-11-19T04:51:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ne1114](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ne1114/32/27869_2.png) [@ne1114](https://forum.babylonjs.com/u/ne1114)\
**Post date:** [November 19, 2022, 4:51am UTC](https://forum.babylonjs.com/t/quick-question-on-rendering-multiple-scenes-on-multiple-canvases/35825/1 "2022-11-19T04:51:02Z")

</div>

Hello,

I’ve been messing with multi scene, multi canvas approaches both with react-babylonjs and babylonjs.

I am trying out very basic just to test if it works. Currently, I made a component that receives ref to canvas, engine, and a color. This component creates a scene, adds camera, meshes, light to the scene. After that it registers view to the canvas with the camera created within the scene.

I made two scenes, one with white cube, the other scene with red cube. However, in the both canvas I see red cube. I expect to see white cube on the first canvas and red cube on the second canvas. Most likely i’m doing something wrong here and it be great to get little bit of advice.

Here is the repro : [testing multiple scene - CodeSandbox](https://codesandbox.io/s/testing-multiple-scene-xxmw13?file=/src/App.tsx)

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [November 19, 2022, 10:08am UTC](https://forum.babylonjs.com/t/quick-question-on-rendering-multiple-scenes-on-multiple-canvases/35825/2 "2022-11-19T10:08:07Z")

</div>

You should check which is the current active view and render the right scene accordingly (see [this section](https://doc.babylonjs.com/features/featuresDeepDive/scene/multiCanvas#multi-scenes) in the doc).

Here’s a corrected code:

> **[testing multiple scene (forked) - CodeSandbox](https://codesandbox.io/s/testing-multiple-scene-forked-8rhfpv?file=%2Fsrc%2FApp.tsx)**
>
> testing multiple scene (forked) by Popov72 using @babylonjs/core, @babylonjs/gui, lodash, react, react-babylonjs, react-dom, react-scripts

---

<div class="post-metadata">

**Author:** ![ne1114](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ne1114/32/27869_2.png) [@ne1114](https://forum.babylonjs.com/u/ne1114)\
**Post date:** [November 20, 2022, 6:08am UTC](https://forum.babylonjs.com/t/quick-question-on-rendering-multiple-scenes-on-multiple-canvases/35825/3 "2022-11-20T06:08:36Z")

</div>

Thank you so much @Evgeni_Popov  
I’m grateful of the fact that Babylon has such a great community 👍
