message: Used state fn to avoid taking states dependency
diff: @@ -6,11 +6,12 @@ import { NavigationStack } from 'navigation-react-native';
  const Stack = ({ children, ...props }) => {
  const stateNavigatorRef = useRef(new StateNavigator([]))
  const stateNavigator = stateNavigatorRef.current;
  - const [states, setStates] = useState([]);
  + const [, setStates] = useState([]);
  useEffect(() => {
  const validateNavigation = ({ __deleted }, _data, _url, _history, { state }) => (
  !__deleted && stateNavigator.states[state.key] === state
  );
  + setStates(oldStates => {
  const { newStates, newStatesLookup } = React.Children.toArray(children)
  .reduce(({ newStates, newStatesLookup }, { props: { name, ...rest }}) => {
  newStates.push({ key: name, ...rest })
  @@ -18,7 +19,7 @@ const Stack = ({ children, ...props }) => {
  return { newStates, newStatesLookup };
  }, { newStates: [], newStatesLookup: {} })
  if (newStates.length) {
  - for(const oldState of states) {
  + for(const oldState of oldStates) {
  if (!newStatesLookup[oldState.key])
  newStates.push({ ...oldState, __deleted: true });
  }
  @@ -32,8 +33,9 @@ const Stack = ({ children, ...props }) => {
  if (changed)
  stateNavigator.navigate(newStates[0].key);
  stateNavigator.onBeforeNavigate(validateNavigation);
  - setStates(newStates);
  + return newStates;
  }
  + });
  return () => stateNavigator.offBeforeNavigate(validateNavigation);
  }, [ children ]);
  return (
  