@babel/plugin-transform-react-constant-elements
In
Out
const Hr = () => {
return _ref;
};
Deopts
-
<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.
{
[
"@babel/plugin-transform-react-constant-elements",
{ "allowMutablePropsOnTags": ["FormattedMessage"] }
]
]
}
You can read more about configuring plugin options here