See this example causes my "routeLoader$" to be clled 2 times, which is an issue for obvious reasons? I couldnt understad how to prevent this.
Please help:
export const useNewsLoader = routeLoader$(async () => {
return {
data: 'example'
};
})
export const head: DocumentHead = ({ resolveValue }) => {
const newsData = resolveValue(useNewsLoader);
...
};
export default component$((props) => {
const newsData = useNewsLoader();
...
});`
I looked into the Qwik source code and resolveValue is using the previous response. I also did this example to verify my thesis. In the console you can see the same random number.