Skip to content

Compile JSX to direct createElement() calls #5435

Open
@gaearon

Description

@gaearon

Due to how webpack works today with CommonJS, we pay the cost of three object property accesses (ReactWebpackBinding.default.createElement) for every JSX call. It doesn't minify well and has a minor effect on runtime performance. It's also a bit clowny.

We should fix this to compile JSX to something like

var createElement = require('react').createElement

createElement(...)

Could be a custom Babel transform. Could be a transform that inserts _createReactElement into scope and specifies it as the JSX pragma.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions