How does the parent-child component of react multi-level nesting pass the value of the child component to the outermost parent component for use?

how does the parent-child component of react multi-level nesting pass the value of the child component to the outermost parent component for use?
clipboard.png

the nesting relationship is topic.js > ModleForm > form.js > editor.js

what should I do if I want to add, delete, modify and query the outermost topic with the value of the innermost level editor?

Mar.28,2021

the parent component writes a method, then passes it all the way to the child component, and then the child component executes this method


it can be handled by the PubSub publish and subscribe event mechanism, which is convenient, or by the way of props transfer function, but it is more troublesome when the level is deep


if you use redux , put all the values in state so that they are available to the task area.
if there is no redux , write a callback function in the parent component to implement it.
for example:

  

without using redux, the parent component can pass the function to the child component through props, and then call the function in the child component, so that the parent component can get the data from the child component through this function.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b4454e-2c6e7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b4454e-2c6e7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?