Skip to content
This repository has been archived by the owner on Jul 20, 2020. It is now read-only.

using Viewport onBeforeRender prop produces warning #224

Open
Danathus opened this issue Apr 4, 2018 · 0 comments
Open

using Viewport onBeforeRender prop produces warning #224

Danathus opened this issue Apr 4, 2018 · 0 comments

Comments

@Danathus
Copy link

Danathus commented Apr 4, 2018

When using @AndrewRayCode 's technique described in #43 (comment) 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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant