2 ms·
Guys, can someone enlight me on how to create a react component that encapsulates an Odometer[1] the React Way? Since it does a lot of direct DOM manipulation,
by xfalcox 12y ago
Guys, can someone enlight me on how to create a react component that encapsulates an Odometer[1] the React Way? Since it does a lot of direct DOM manipulation, I'm not sure of how to do it.
[1] https://github.com/HubSpot/odometer https://github.com/HubSpot/odometer
- smharris65 12y agoReview the link below for a simple example of a Radial Gauge component. This is just the basic 'wrapping' of an existing UI component so more can be done: http://ifandelse.com/using-reactjs-and-kendoui-together/ The JSFiddle example is here: http://jsfiddle.net/ifandelse/U5P32/light/
- mambodog 12y agoTypically you would render a single root element and then use the 'after' lifecycle methods (componentDidMount, componentDidUpdate) to grab the root element (with getDOMNode) and make your changes (eg. call a jQuery plugin method on the dom node) Here's a jsfiddle for the specific lib you're talking about (Odometer): http://jsfiddle.net/p1h7rn3q/ http://jsfiddle.net/p1h7rn3q/