Closed hlynurstef closed 2 years ago
I just updated to v.1.0.10 and I noticed that useParam is not giving me the expected value in React Native when I use the following code:
useParam
Login screen that calls router.push:
router.push
import { useRouter } from "solito/router"; export const LoginScreen: React.FC => { const router = useRouter(); const signIn = useCallback(async () => { router.push(`/home/foobar`); }, [router]); return <Button onPress={signIn}>Login</Button>; }
Home screen that gets id using useParam:
import { createParam } from "solito"; const { useParam } = createParam<{ id: string }>(); export const HomeScreen: React.FC => { const [id] = useParam("id"); return <Text>{`User ID: ${id}`}</Text> }
In version 0.0.29 useParam returns "foobar" In version 1.0.10 useParam returns {id: "foobar"}
0.0.29
"foobar"
1.0.10
{id: "foobar"}
Is this expected or a bug? I couldn't find any reference to changes to the API in the release notes or in the docs.
Oh wow, that’s not good. I’m pushing a fix now. Sorry about that.
Should be fixed in 1.0.11. Can you let me know?
1.0.11
Confirmed fixed in 1.0.11, thanks for the quick fix!
great!
I just updated to v.1.0.10 and I noticed that
useParam
is not giving me the expected value in React Native when I use the following code:Login screen that calls
router.push
:Home screen that gets id using
useParam
:In version
0.0.29
useParam
returns"foobar"
In version1.0.10
useParam
returns{id: "foobar"}
Is this expected or a bug? I couldn't find any reference to changes to the API in the release notes or in the docs.