I play with React for few days, everything seemed fairly easily, until I got stuck with rewriting this JS object as a React component.
This is JsFiddle Example with JS object example. How to go about rewriting this as React component?
This is what I was trying:
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import ProgressBar from 'progressbar.js';
class Circle extends Component{
componentDidMount() {
this._create(this.props);
}
_create(props) {
var container = ReactDOM.findDOMNode(this.refs.progressBar);
container.animate(props.progress);
}
render() {
retu <div ref="progressBar"></div>;
}
}
Circle.defaultProps = {
options: {},
progress: 1.0,
}
export default Circle;
