Last active
July 1, 2018 09:59
-
-
Save coryhouse/a07d894735216cbbc989100fe79e1779 to your computer and use it in GitHub Desktop.
UserDetails component consuming a centralized PropType
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
import React from 'react'; | |
import {userType} from './types'; | |
function User({ user }) { | |
return ( | |
<div> | |
<h1>{user.firstName} {user.lastName}</h1> | |
</div> | |
) | |
} | |
User.propTypes = { | |
user: userType.isRequired | |
}; | |
export default User; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment