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
exportinterfaceIconProps{size?: number;}// I use this to create a type that has `size` non-nullable // (because it always present due to `defaultProps`typeSafeProps=IconProps&typeofIcon.defaultProps;exportdefaultclassIconextendsReact.Component<IconProps,any>{staticdefaultProps={size: 10};render(){// cast to SafeProps to safely extract `size`const{ size }=this.propsasSafePropsreturn<divstyle={{ size }}/>}}
Expected behavior:
It compiles. This actually works in 2.2.2
Actual behavior:
Class 'Icon' used before its declaration on line type SafeProps = IconProps & typeof Icon.defaultProps;
TypeScript Version: typescript@rc 2.3.0
Code
Expected behavior:
It compiles. This actually works in 2.2.2
Actual behavior:
Class 'Icon' used before its declarationon linetype SafeProps = IconProps & typeof Icon.defaultProps;Is this an intended breaking change?