my script;
When my goal is to change the line,
Clear the selection and update the state lines.

Since it enters the console.log (a) at first boot, I need to clear the selection.
(First Render Console)

but when I update props.rows,
both lines should be updated, as well as clear the selection.
(Set Props Render Console)

but when I do with callback, the current props.rows are not coming. When the first opening works on.
will not work on first boot. It will only work on line changes. it also needs to arrive up to date line information.
callback does not show the current line information :(
how do i do it like componentWillReceiveProps?
@gaearon
Why does useEffect work on first boot even though props.rows is connected and props.rows is unchanged? Shouldn't it expect props.rows to change?
got the same problem!
i understood why the view update is async, but why the setXXX also is async
can anyone else can explain it? i just wanna the state can be update in time when i setXXX
I think the following documents can help you
Why am I seeing stale props or state inside my function?
location has nothing to do with this.
I just want something similar to the componentWillReceiveProps property. As shown here, useEffect works on first boot. I have written a callback to work after the prop is updated. its does not come up to date prop. that is ridiculous.
Why does useEffect work on first boot even though props.rows is connected and props.rows is unchanged? Shouldn't it expect props.rows to change?

i am writing a common component Select, i think take all data state whthin the comp would be best.
when i togg the props of options,then to udpate the opt!
but when i get the default value from opt , its still the previous options;
why the state update is async~
do not say i render the view with options directly. that will take some comp state out of the Select.
i dont thinks it's a constructive style.
any opine is appreciate!
This issue does not provide enough context for us to be able to help. Pictures of parts of code are usually not enough for someone to be able to spot a problem. (The problem is often in the code that is not pictured, or the way the code fits together.) This is why we usually as for something like a Code Sandbox that reproduces the problem.
Looking at the way you're things like props.grouping to grouping state and calling setGrouping in an effect any time the props change- I think you should probably read this blog post:
https://reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html
Although that blog post was written for class components, the general patter of syncing state and props can apply to hooks as well- and looks like it would apply here.
If you'd like us to take a closer look at why one of your props isn't updating as expected, please give us some code we can actually see all of (and run). I'm going to close this issue though because I think there's not much more help we can provide beyond my answer above.
Good luck!