News for hackers. Stuff that matters.
Re:Nue.js: Rethinking Reactivity by YuukiRey on Monday October 02, 2023 @06:03AM (#37736125)
Hmmm.... I think that's because to use one of the React hooks you need to import them from React. If you create your own hook it'll eventually use something like "useState" internally, which leads you to "import { useState } from 'react'".

Functional components on their own are not distinguishable from a good old Javascript function. I guess the presence of JSX and/or hooks give it away. I'd say it's half true that glancing at a random .js file it might not be immediately obvious if it's React or a function, but with some digging you should be able to find out by following the imports.

There are no comments on this comment yet.