When using @AndrewRayCode 's technique described in https://github.com/toxicFork/react-three-renderer/issues/43#issuecomment-326762590 re: using two <viewport>s to render a secondary subscene (potentially with different cameras), and leveraging use of the Viewport's onBeforeRender member, react-three-renderer issues the following warning in the console:
warning.js?da67:33 Warning: Foreign prop onBeforeRender found in viewport. Check the render method of 'ClassWithRenderFunction'.
Note that the behavior is as expected otherwise -- the Viewports are rendered in the order listed, each using whatever camera is referenced, and each calling any specified onBeforeRender call as listed before rendering.
I believe this shouldn't be a warning, and have an idea towards the solution. I had noticed that in the react-three-renderer source, in Viewport.js, onBeforeRender is initialized from props. However, in ViewportDescriptor.js, onBeforeRender is not referenced as a property in the code. I think that by adding this property here properly can resolve this issue so use of the property is not mistakenly flagged as a warning.
When using @AndrewRayCode 's technique described in https://github.com/toxicFork/react-three-renderer/issues/43#issuecomment-326762590 re: using two
<viewport>
s to render a secondary subscene (potentially with different cameras), and leveraging use of theViewport
'sonBeforeRender
member,react-three-renderer
issues the following warning in the console:warning.js?da67:33 Warning: Foreign prop onBeforeRender found in viewport. Check the render method of 'ClassWithRenderFunction'.
Note that the behavior is as expected otherwise -- the
Viewport
s are rendered in the order listed, each using whatever camera is referenced, and each calling any specifiedonBeforeRender
call as listed before rendering.I believe this shouldn't be a warning, and have an idea towards the solution. I had noticed that in the
react-three-renderer
source, inViewport.js
,onBeforeRender
is initialized fromprops
. However, inViewportDescriptor.js
,onBeforeRender
is not referenced as a property in the code. I think that by adding this property here properly can resolve this issue so use of the property is not mistakenly flagged as a warning.