3 ms·
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 lik
by YuukiRey 3y ago
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.