Created
December 21, 2018 18:25
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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