QwikDev / qwik

Instant-loading web apps, without effort
https://qwik.dev
MIT License
20.83k stars 1.31k forks source link

[🐞] Outdated lint warning for routeAction$/routeLoader #3408

Closed mhevery closed 1 year ago

mhevery commented 1 year ago

Which component is affected?

Qwik Runtime

Describe the bug

import { component$ } from "@builder.io/qwik";
import {
  routeLoader$,
  Form,
  routeAction$,
  server$,
} from "@builder.io/qwik-city";

// WARNING: The return of `routeLoader$()` needs to be exported in the same module, like this
const useDadJoke = routeLoader$(async () => {
});

// WARNING: The return of `routeAction$()` needs to be exported in the same module, like this
const useJokeVoteAction = routeAction$((props) => {
});

export default component$(() => {
  const dadJokeSignal = useDadJoke();
  const favoriteJokeAction = useJokeVoteAction();
  return ...;
});

Reproduction

above

Steps to reproduce

No response

System Info

n/a

Additional Information

No response

manucorporat commented 1 year ago

it needs to be exported! the lint is correct! this is a different reason as the $() routeAction and routeLoader, must be exported!