semiotic icon indicating copy to clipboard operation
semiotic copied to clipboard

responsive frame types do not extend base types

Open cainlevy opened this issue 5 years ago • 2 comments

The types available for various ResponsiveFooFrame components do not extend their base types. For example, TypeScript says there is no points prop available on <ResponsiveXYFrame />.

cainlevy avatar Jul 16 '20 18:07 cainlevy

My attempted workaround:

type CombinedXYFrameProps = React.ComponentProps<typeof ResponsiveXYFrame> & React.ComponentProps<typeof XYFrame>;
class TypedResponsiveXYFrame extends React.Component<CombinedXYFrameProps> {
  render() {
    return <ResponsiveXYFrame {...this.props} />;
  }
}

cainlevy avatar Jul 16 '20 18:07 cainlevy

Good catch.

emeeks avatar Jul 30 '20 03:07 emeeks