I am trying to export prop types from one view component to another container component and use them as state type definitions:
// ./Component.tsx
export type Props {
someProp: string;
}
export const Component = (props: Props ) => {
...etc
}
// ./AnotherComponent.tsx
import { Component, Props as ComponentProps } from "./Component";
type Props = {}
type State = ComponentProps & {};
class AnotherComponent extends React.Component<Props, State> {
state: State;
...etc
}
However I am getting in console:
Module '"./Component "' has no exported member 'Props'.
Any suggestions for how I should be going about this?
I have also tried using lookup types as per this article, but no joy.
Module '"./AnotherComponent "' has no exported member 'Props'.butModule "./Component" has exported member 'Props'.cheers