0

I make a onclick callback function in Top_Menu.jsx file and I want to create this function on other component. how can I do this..?

[Top_Menu.jsx]

[Left_Menu.jsx]

I make a onclick callback function in Top_Menu.jsx file and I want to create this function on other component. how can I do this..?

Top_Menu.jsx Left_Menu.jsx

krishnaacharyaa
  • 14,953
  • 4
  • 49
  • 88
Rifath
  • 1
  • 1
  • Hi there, welcome to SO. Try to create a [minimal runnable code](https://stackoverflow.com/help/minimal-reproducible-example) so we can he you better. – Abdulrahman Ali Dec 21 '22 at 17:13
  • Is it possible to make a question self-contained e.g. to include snippets of code you're referring to here, in the question body directly as a text, not images... – nakhodkin Dec 21 '22 at 17:14
  • About your question, it looks like you need to pass the function as a prop in case when component is a parent to the other. – Abdulrahman Ali Dec 21 '22 at 17:14
  • hi might be of interest https://stackoverflow.com/questions/39119537/reactjs-call-one-component-method-from-another-component – jspcal Dec 21 '22 at 17:26

0 Answers0