Skip to content

render arrow functions breaking in 2.0.0-beta.17 #828

@johnlindquist

Description

@johnlindquist

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"

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions