-
Notifications
You must be signed in to change notification settings - Fork 19
RFC: Switch from createElement
to the default pragma
#22
Comments
We overwrote the pragma because we thought we might have to monkeypatch |
No, that wouldn't have anything to do with it. |
I can't speak to that - I didn't set this up initially. |
In the original concept, you (@zetlen) had indicated we might consider replacing React with another library, such as Preact. While I don't think Andrew or I ever supported that idea, it was on my mind when creating this repo that we might have to change every file with JSX at some point. Whichever pragma we use has to be imported by every file containing JSX. Whether it's The problem with That was the reasoning behind it, anyway. If we're sticking with React for good, it doesn't make much difference what pragma we use. I think comparing this to TypeScript is apples to oranges; this is minor, TS is major. |
This would never be something we have to do, though. If Preact was used, we would have to use |
This issue was moved to magento/pwa-studio#21 |
Edit: For those looking to contribute, the following changes need to be made:
createElement
import in each file (ex:import { Component, createElement } from 'react';
) toimport React from 'react';
orimport React, { Component } from 'react';
Peregrine
to make the same updatesPart of our reasoning for not using things like TS is that we didn't want to diverge too much from code people will see in examples.
Right now, we're over-writing Babel's pragma for
React.createElement
to justcreateElement
. This is going to be surprising for people copy/pasting code from tutorials.Proposing we go back to the default pragma.
The text was updated successfully, but these errors were encountered: