@babel/preset-react

    .babelrc

    Without options:

    1. {
    2. }

    Via CLI

    1. babel --presets @babel/preset-react script.js

    pragma

    string, defaults to React.createElement.

    Replace the function used when compiling JSX expressions.

    string, defaults to React.Fragment.

    Replace the component used when compiling JSX fragments.

    useBuiltIns

    , defaults to false.

    Will use the native built-in instead of trying to polyfill behavior for any plugins that require one.

    Toggles plugins that aid in development, such as @babel/plugin-transform-react-jsx-self and .

    This is useful when combined with the env option configuration or .

    throwIfNamespace

    boolean, defaults to true.

    Toggles whether or not to throw an error if a XML namespaced tag name is used. For example:

    1. <f:image />

    Though the JSX spec allows this, it is disabled by default since React's JSX does not currently have support for it.

    .babelrc.js

    .babelrc

    1. {
    2. "presets": ["@babel/preset-react"],
    3. "env": {
    4. "development": {
    5. "presets": [["@babel/preset-react", { "development": true }]]
    6. }
    7. }