Open betfix opened 3 years ago
I have the following app:
//App.svelte <script> import { Route, Router } from 'svelte-navigator' import Temp from './Temp.svelte' </script> <Router> <Route path="/temp" component={Temp} /> </Router>
//Temp.svelte <script> import { useLocation } from 'svelte-navigator' const location$ = useLocation() $: console.log(JSON.stringify($location$)) </script>
After going to /temp path (or refreshing) there are two identical messages in console:
/temp
{"pathname":"/temp","hash":"","search":"","state":null} {"pathname":"/temp","hash":"","search":"","state":null}
Why is the reactive statement called twice if the location didn't change?
I have the following app:
After going to
/temp
path (or refreshing) there are two identical messages in console:Why is the reactive statement called twice if the location didn't change?