I update the parentcomponent from child component and in return i get the new props from parent, and then i want the child state to get updated based on the prop.

```
    export default function ParentCompnent(){
        [name,setName] = useState("test")

        function setNameMod(){
            setName(some random name)
        }
        render(
            <>
            <ChildComponent name=name setNameMod=setNameMod />
            </>
        )

    }

    function ChildComponent(props){
        {name,setNameMod} = props
        [steps,setSteps] = useState(getSteps(name))
        getSteps(name){
            .....
            return some_array
        }

        function refreshSteps(){
            setNameMod()

            setSteps(getSteps(name))
            // i am expecting new name from parent be used here
            // but it looks the old name is being used.
        }

        render(
            <>
            <button onclick={()=>refreshSteps()}>Refresh</button>
            steps.map(....)
            </>

            )
    }

```

I can put the steps in parent and pass as props. but i want to keep the logic at one place

Now can i do this