React Base Fiddle (JSX)

Starting point for creating JSFiddles with React. This uses React with Addons.

by chrisbenseler

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.1/JSXTransformer.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.1/react-with-addons.js"></script>
<script src="https://facebook.github.io/react/js/jsfiddle-integration.js"></script>

<div id="container">
    <!-- This element's contents will be replaced with your component. -->
</div>

JavaScript 1.7

var DateLabel = React.createClass({

	propTypes: {
		/**
		 * Data em formato ISO 8061: iso8061date = "2015-09-01T00:00:00Z"
		 */
		iso8061date: React.PropTypes.string,

		/**
		 * pattern de formatação de data 
		 */
		pattern: React.PropTypes.string
	},

	_formatdate: function() {
    	var txt = this.state.date.getDate() + "/" + (this.state.date.getMonth() + 1) + "/" + this.state.date.getFullYear();
        
        return txt;
    },

	getInitialState: function() {
		var date = new Date(this.props.iso8061date);
        return {date: date };
    },

    render: function() {
    	
        return <span>{ this._formatdate() }</span>;
    }

});
 
React.render(<DateLabel iso8061date="2015-09-01T00:00:00Z" />, document.getElementById('container'));