Last active
August 3, 2020 11:56
-
-
Save wjx0820/e55ebcf1d4f83c9273cb94c27962dc83 to your computer and use it in GitHub Desktop.
使用React.PropsWithChildren或者 React.FC给带 children props 的组件 定义类型
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
// App.tsx | |
import { Button } from "./components/Button" | |
function App() { | |
return ( | |
<div className="App"> | |
<Button | |
onClick={(e) => { | |
e.preventDefault() | |
console.log(e) | |
}} | |
> | |
Hello World | |
</Button> | |
</div> | |
) | |
} | |
export default App |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment