frontarm / navi

🧭 Declarative, asynchronous routing for React.
https://frontarm.com/navi/
MIT License
2.07k stars 71 forks source link

<Link prefetch='mount'> not firing on mount #165

Closed tony closed 4 years ago

tony commented 4 years ago

We revised prefetch: true to be prefetch: 'mount", but kept the comparison to === true in the useEffect. I believe this makes the mount behavior only fire when true is passed, but that can never happen since === true is changed to 'mount' in the deprecation conditional:

https://github.com/frontarm/navi/blob/137a81f41ced60e5b53d49540396e9f3ee87eeaf/packages/react-navi/src/Link.tsx#L111-L125

Where mount prefetch happens:

https://github.com/frontarm/navi/blob/137a81f41ced60e5b53d49540396e9f3ee87eeaf/packages/react-navi/src/Link.tsx#L176-L180