Skip to content

Instantly share code, notes, and snippets.

@kasper573
Created June 29, 2018 19:31
Show Gist options
  • Save kasper573/6eb821e22a313757a9d3b60d9ee48f61 to your computer and use it in GitHub Desktop.
Save kasper573/6eb821e22a313757a9d3b60d9ee48f61 to your computer and use it in GitHub Desktop.
type AProps = {foo: string, prop?: string};
type BProps = {bar: number};
class A extends React.Component<AProps> {}
class B extends React.Component<BProps> {}
class AB extends React.Component<AProps & BProps> {
render () {
const {aProps, bProps} = split(runtime AProps, runtime BProps, this.props);
return (
<A {...aProps}>
<B {...bProps}/>
</A>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment