I've got this weird message after following a React tutorial building a simple app. http://blog.revathskumar.com/2014/05/getting-started-with-react.html
I used bower to install react and included the scripts like so:
<script src="bower_components/react/react.js"></script>
<script src="bower_components/react/JSXTransformer.js"></script>
as in the tutorial. At first I thought the scripts weren't loaded but that's obviously not the case. What is the problem?
These days it is
ReactDOM.render(
and include the source file:
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.0/react-dom.js"></script>
This is the warning from React:
Warning: React.render is deprecated. Please use ReactDOM.render from require('react-dom') instead.
bower installs the latest version in this case version 0.12.0.
there is a change in the render function convention.
https://facebook.github.io/react/blog/2014/10/28/react-v0.12.html
Component has been removed from all of our React.render* methods.
so use
React.render(
instead of
React.renderComponent(
Lately 'React.render()' is depreciated So use 'ReactDom.render()'
import React from 'react';
import ReactDom from 'react-dom';
import App from './components/App.jsx';
require('./main.scss');
ReactDOM.render(<App />, document.getElementById('container'));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With