Hacker News new | ask | show | jobs
by tills13 1772 days ago
To clarify, I'm not talking about the ref _prop_, I'm talking about them using the ref as the element.
2 comments

It’s lowercase, so it will act as plain-old tag. If the name would be uppercase, that would be a bug you described.
hm, 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.
no 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] }