The code below
- Works in "1.2.3"
- Breaks in "2.0.0-beta.17"
import React, { Component } from 'react'
export default class App extends Component {
render = () => <div>Hi</div> //notice the arrow function
}
Errors:
warning.js?1292f09:36 Warning: App(...): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.
warning.js?1292f09:36 Warning: React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server:
(client) " data-reactid="1"><!-- react-empty: 2 -
(server) " data-reactid="1"><div data-reactid="2"
The code below
Errors: