SolidJSS
SolidJSโ€ข16mo agoโ€ข
5 replies
Misery

`onMount` not called / Component not rendered?

I seriously do not know why this doesnt work:
export default function About() {
  const [version, setVersion] = createSignal("Loading...");

  onMount(() => {
    console.log("onMount triggered");

    const version = getVersion();
    setVersion(version);
  });

  return (
    <main>
      <Title>About MCS</Title>
      <p>Running {version()}</p>
    </main>
  );
}

function getVersion() {
  return "dummy";
}

as seen in the
onMount
line, im expecting a onMount Triggered message on my browser devtools but i seemingly get nothing. which leads me to the conclusion that my component isnt being rendered. this is backed up by the fact that the title hasnt changed

any reasons as to how this happens? Im at my wit's end trying to understand why to no avail
Was this page helpful?