I\'ve a React component. Some elements will be inserted through the children. Some of these elements will have a specific classname. How can I get a list of these DOM nodes
You can achieve it, via findDOMNode of react-dom, like below:
findDOMNode
react-dom
ReactDOM.findDOMNode().getElementsByClassName('snap') // Returns the elements
If you need the count,
ReactDOM.findDOMNode().getElementsByClassName('snap').length