@babel/plugin-transform-react-constant-elements

    In

    Out

    1. const Hr = () => {
    2. return _ref;
    3. };

    Deopts

      1. <div {...foobar} />
    • Refs

    • Mutable Properties

      If you are using a particular library (like react-intl) that uses object properties, and you are sure that the element won’t modify its own props, you can permit objects to be allowed for specific elements.

      This will skip the Mutable Properties deopt.

      1. {
      2. [
      3. "@babel/plugin-transform-react-constant-elements",
      4. { "allowMutablePropsOnTags": ["FormattedMessage"] }
      5. ]
      6. ]
      7. }

      You can read more about configuring plugin options here