Skip to content

Instantly share code, notes, and snippets.

@pkellner
Created December 21, 2018 18:25
Show Gist options
  • Save pkellner/6cfd0c9a9cfff2f8440fe518a3dfb277 to your computer and use it in GitHub Desktop.
Save pkellner/6cfd0c9a9cfff2f8440fe518a3dfb277 to your computer and use it in GitHub Desktop.
Be nice to get some hint of what type children should be in typescript
import React, {FunctionComponent} from 'react';
interface Props {
errorMessage: string,
children: JSX.Element
}
const ErrorSegment: FunctionComponent<Props> =
({errorMessage,children}) => {
return (
<div>
<b>ErrorSegment</b>
<hr/>
{errorMessage}
<hr/>
{children}
</div>
);
};
export default ErrorSegment;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment