dwmkerr / dwmkerr/react-es6-starter
use ReactDOM instead of deprecated React.render
- Dominant language
- JavaScript
- Stars
- 12
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
Since your blog post, it looks like React has separated out react-dom and deprecated React.render. These are the console errors I get:
```
Warning: React.render is deprecated. Please use ReactDOM.render from require('react-dom') instead.warning @ bundle.js:9378newFn @ bundle.js:26937(anonymous function) @ bundle.js:7414__webpack_require__ @ bundle.js:20(anonymous function) @ bundle.js:48__webpack_require__ @ bundle.js:20(anonymous function) @ bundle.js:40(anonymous function) @ bundle.js:43
bundle.js:9378 Warning: render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app.
```
The fix is just `npm install --save react-dom` and add change app.js to the following:
``` javascript
import React from 'react';
import ReactDOM from 'react-dom';
import Home from './home/home';
ReactDOM.render(, document.body);
```
I can create a PR if you want. That still doesn't fix the warning for rendering to the body, but that's a separate issue.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by checking app.js and the project dependency setup, then run the reported app to confirm the React.render warning. Install react-dom and update app.js so rendering uses ReactDOM; done means the deprecated React.render warning is gone, while the document.body warning remains a separate issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100