Last active
March 17, 2021 19:23
-
-
Save jhonsore/ac988c8fa026425e133c6e12111b443d to your computer and use it in GitHub Desktop.
Typescript tips
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, { InputHTMLAttributes } from 'react'; | |
| interface InputProps extends InputHTMLAttributes<HTMLInputElement> { | |
| name: string; | |
| } | |
| const Input: React.FC<InputProps> = props => { | |
| return <input { ...props } /> | |
| } | |
| export default Input; | |
| /** | |
| This code creates a simple react input component with Typescript | |
| **/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment