one icon indicating copy to clipboard operation
one copied to clipboard

One throws `React state update on a component that hasn't mounted yet` when using Tab navigator with more then one tab

Open christianjuth opened this issue 1 year ago • 2 comments

When I create a new One project using One 1.1.392 I am getting a React error when using the tab navigator.

  1. Clone the reproduction repo
  2. npm i
    • You may need to add the --force flag as the default one template with npm has been giving me issues recently
  3. npm run dev
  4. Open in Expo Go
  5. You should see the following error
[error] Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead. {"name":"Component Stack"}

Interestingly, if I only register one <Tab.Screen /> I don't get the error, but as soon as I add the second I see the error.

christianjuth avatar Jan 09 '25 22:01 christianjuth

Try updating to the latest version of 'one'. That fixed this exact issue for me.

justinmclaren avatar Jan 22 '25 02:01 justinmclaren

@justinmclaren I still see the error. Also glanced at the commits and I don't think I saw any change to the tab navigation, though I might be wrong about that part.

christianjuth avatar Jan 23 '25 23:01 christianjuth