You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migrate the instance.getDefaultProps() to static Klass.defaultProps
Motivation
Stays more in alignment with the inspired react apis
I don't think we should rely on instance for providing default values for a component
I'd personally prefer composition over inheritance.
The static syntax looks more obvious & cleaner than the getDefaultProps hook. Can be separated from the implementation if required which opens up more space for docs generation
FEATURE REQUEST / CODE CHANGE
Summary
Migrate the
instance.getDefaultProps()
to staticKlass.defaultProps
Motivation
static
syntax looks more obvious & cleaner than thegetDefaultProps
hook. Can be separated from the implementation if required which opens up more space for docs generationDetailed design
How we teach this
This change would be breaking in two aspects
this
context while providing the defaultPropsSo, a major version bump would be my call
Alternatives
The text was updated successfully, but these errors were encountered: