Skip to content

Adding react three fiber objects manually to scene #2675

Answered by drcmda
jolgau asked this question in Q&A
Discussion options

You must be logged in to vote

this is not react im afraid. you never call add/remove imperatively. the whole point of react is that you lay out the scene declaratively, it is always returned in a function, it is the outcome of state. all composition is functional:

function GridHelper({ children }) {
  return (
    <>
      <Grid ... />
      <Center top>
        {children}
      </Center>

<GridHelper>
  <mesh />

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jolgau
Comment options

Answer selected by jolgau
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants