pmndrs / react-three-fiber

🇨🇭 A React renderer for Three.js
https://docs.pmnd.rs/react-three-fiber
MIT License
27.62k stars 1.6k forks source link

fix: make textinstance no-op instead of warn #3366

Closed Amatewasu closed 1 month ago

Amatewasu commented 1 month ago

This PR aims to implement the behavior described in https://github.com/pmndrs/react-three-fiber/issues/3302

I did not achieve to test it on a local project (even though I succeeded a few months ago). Do you have some documentation to provide to compile and test on a project?

codesandbox-ci[bot] commented 1 month ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 213d2c3e625ef9ae52820874d2ce9273fda98ee7:

Sandbox Source
example Configuration
DennisSmolek commented 1 month ago

I did not achieve to test it on a local project (even though I succeeded a few months ago). Do you have some documentation to provide to compile and test on a project?

You can run your changes against the examples by running yarn examples

Heres more info on building/testing: https://github.com/pmndrs/react-three-fiber/blob/master/CONTRIBUTING.md

Amatewasu commented 1 month ago

@DennisSmolek Thank you a lot!

Printing the text definitely works (I've added a fragment: <>hello</>):

image

But I struggle to pass the property to the renderer. We might want to only print the text.

CodyJasonBennett commented 1 month ago

Perhaps we should only no-op here. We can't make warnings or errors useful without tracing, and I have not found a reliable way to obtain this.

Amatewasu commented 1 month ago

no-op would make sense because we do not expect text to be drawn without a proper component in a r3f canvas

if ok for you i can update the PR

Amatewasu commented 1 month ago

@CodyJasonBennett I have just updated the PR to make handleTextInstance no-op (super light PR...)