3 ms·
To clarify, I'm not talking about the ref _prop_, I'm talking about them using the ref as the element.
by tills13 5y ago
To clarify, I'm not talking about the ref _prop_, I'm talking about them using the ref as the element.
- mlajtos 5y agoIt’s lowercase, so it will act as plain-old tag. If the name would be uppercase, that would be a bug you described.
- tills13 5y agohm, interesting. I didn't know that -- I knew about custom tags / variable tags but never knew it _required_ them to be PascalCased. I feel like if I saw code like this come from one of my team members I'd ask them to change the name of the ref.
- mlsarecmg 5y agono ref is used as an element in that code. const ref = useRef() useEffect(() => console.log(ref), []) return <div ref={ref} /> will return { current: [dom node] } const ref = useRef() useEffect(() => console.log(ref), []) return <mesh ref={ref} /> will return { current: [mesh node] }