react-three-gui icon indicating copy to clipboard operation
react-three-gui copied to clipboard

multi-target

Open brianzinn opened this issue 5 years ago • 4 comments

brianzinn avatar Sep 04 '20 22:09 brianzinn

You will note that the ContextProvider does not work with another target. The context cannot cross boundaries of reconciler - it's kind of a bug with React, so you will see the bridge that I built to consume and provide across the boundary. You essentially need to do the same with Canvas maybe instead of hard-coding three in your provider.

Those fixes you added are a big improvement - before when I was rendering the controls kept being re-added, so it works much better now. I think if you added a static default loader would fix the parts that I commented out - have a look at what's there right now and let me know. Cheers.

brianzinn avatar Sep 04 '20 22:09 brianzinn

For issue #20

brianzinn avatar Sep 04 '20 22:09 brianzinn

Fantastic! Thank you for the PR, I will take a look and make the adjustments you mentioned.

birkir avatar Sep 05 '20 19:09 birkir

hi @birkir I can update this to work with your new API, if you still were interested in multi-target - the exported ContextProvider helps a lot! Following along in the other conversation I also tried to find a seamless way as a library developer to not use context and it is inconvenient to require bridging across renderers, so would be interested if you go a different way. I can make a new PR later this week or otherwise you can close if not interested. Thanks :)

brianzinn avatar Oct 20 '20 19:10 brianzinn