Last active
April 5, 2021 17:51
-
-
Save jonstoked/c89bbcb5a2a8f1ab151dcaae582f401c to your computer and use it in GitHub Desktop.
TypeScript Error
This file contains 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
// This React app contains a type-related error. | |
// Please find it and explain how you would fix it. | |
import React, { ReactElement } from 'react'; | |
import './App.css'; | |
function Heading({ title }: { title: string }) { | |
return <h1>{title}</h1>; | |
} | |
function Container({ children }: { children: string }): ReactElement { | |
return <div>{children}</div>; | |
} | |
function App() { | |
return ( | |
<div> | |
<Container> | |
<Heading title="Welcome!"></Heading> | |
<p>Stay a while.</p> | |
</Container> | |
</div> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment