nteract / semiotic

A data visualization framework combining React & D3
https://semioticv1.nteract.io/
Other
2.43k stars 133 forks source link

responsive frame types do not extend base types #528

Open cainlevy opened 4 years ago

cainlevy commented 4 years ago

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 commented 4 years ago

My attempted workaround:

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

Good catch.