What is the "&" sign in a class definition?
In my class I found out that I need the following class definition:
class myList extends Component<RouteComponentProps<any> & IMyList> {
I find many other examples with comma instead of &, but with comma I get the error:
prop x does not exist
IMyListextendRouteComponentProps<any>&means intersection ie the props will beRouteComponentProps<any>andIMyList. Putting a,mean you are passing the other type parameter (for state) and thus props will beRouteComponentProps<any>and state will beIMyList