SolidJSS
SolidJSβ€’7mo agoβ€’
13 replies
hyperknot

Async in onMount OK?

Is the following pattern OK?

export const AppUI: Component = () => {
  onMount(async () => {
    // await ...
  })

  return (
    <div>
       ...
    </div>
  )
}


I've always used it, but now Biome added https://biomejs.dev/linter/rules/no-misused-promises/ and it thinks it's an error, because

"This function returns a Promise, but no return value was expected.
This may not have the desired result if you expect the Promise to be await-ed."
Biome
Learn more about noMisusedPromises
noMisusedPromises
Was this page helpful?