babel-plugin-inline-react-svg icon indicating copy to clipboard operation
babel-plugin-inline-react-svg copied to clipboard

Support for generating SVG components without `.defaultProps`

Open Grohden opened this issue 11 months ago • 15 comments
trafficstars

This should close https://github.com/airbnb/babel-plugin-inline-react-svg/issues/126

I've changed the code to:

  • Use inline 'defaultProps' in the generated SVG components
  • Use object.assign to merge the prop overrides (see linked issue)
  • Use an option (emitDeprecatedDefaultProps) that allows this package users to still keep emitting the defaultProp declarations

I've made the option to omit default props an opt-out, so it is a breaking change.. but up for the author to change that to a default false

Grohden avatar Dec 05 '24 14:12 Grohden