custom react hook similar to useEffect for adjusting some state when a prop changes https://react.dev/learn/you-might-not-need-an-effect#adjusting-some-state-when-a-prop-changes