DEV Community

All In Developer
All In Developer

Posted on Edited on Originally published at all1n.dev

๐Ÿ”— Don't return early from React.Component when using React.createRef

A ref created with React.createRef can quietly stay null in a class component, with no error and no warning. I ran into one case where that happens, and it was subtle enough that I proposed a note for the official React docs.


๐Ÿ‘‰ Continue reading on my blog: ๐Ÿ”— Don't return early from React.Component when using React.createRef

Top comments (0)