Trying to call a function in another component to open a Modal ? #1932
ashleyjamesbrown
started this conversation in
General
Replies: 2 comments
-
AH the forwardref and imperative was fine it was that i should have called the onclick in the render component. I had some error about button class which wasnt at all helpful....... Sorry. Fixed now |
Beta Was this translation helpful? Give feedback.
0 replies
-
and this
but then the mesh i want to have the click i do it here in app.js in the render
The last bit was where i was going wrong as i was trying to write the onclick to call the function inside the qmodels component..... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a simple component that i can then call in my app.js as
and here is the exported function
What I really want is that toggleModal function available inside another component so that in my threejs mesh onclick i can call that to popup the modal.
three
Im very new to react land and i tried a forwardRef and Imperative Handle on the function and i also tried making the function a use and i got a lot of errors around hooks.
I read im supposed to use props ?
I would really very much appreciate some guidance as how to go about achieving this. Im a three.js and long time javascript user but cant get my head around this way
Many Thanks
Ashley
Beta Was this translation helpful? Give feedback.
All reactions