Intended way of lifting up selected rows
I'm still new to this but I'm not finding a nice way to lift up selected rows to a parent and then to different component. For example, I have a parent container component, which contains a modal component and the table component. Selected rows should be visible in the modal. So my idea was it, to setup a useEffect with [table, rowSelection] dependencies. In the parent component I would write the selected rows to another state variable and move it to the modal, but it immediately creates a rendering loop. I've also tried to instead write the selected elements to context, but it has the same problem.
What is the intended way of lifting information like this up?
Can I instead of using an effect to observe this "event" access the events differently?
0 Replies