Created
August 8, 2021 17:03
-
-
Save Ebazhanov/6d50648aaef525a19ee8f629abe05c54 to your computer and use it in GitHub Desktop.
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"; | |
// define a Navigation Link type for our links | |
export type NavLinkPropType = { | |
label: string; | |
route: string; | |
}; | |
const AppHeaderNavLink: React.FC<NavLinkPropType> = ({ label }) => { | |
return <span className="nav-link">{label}</span>; | |
}; | |
export default AppHeaderNavLink; | |
/** | |
* =====================================an other example | |
* **/ | |
import React from "react"; | |
interface Location { | |
latitude: string; | |
longitude: string; | |
height?: number | undefined | string; | |
} | |
interface PersonProps { | |
name: string; | |
birthDate: Date; | |
birthLocation: Location; | |
} | |
export default function Person({ | |
name, | |
birthDate, | |
birthLocation | |
}: PersonProps) { | |
return ( | |
<div> | |
<div>Name: {name}</div> | |
<div>Birth Date: {birthDate.toISOString()}</div> | |
<div>Loc Latitude: {birthLocation.latitude}</div> | |
<div>Loc Longitude: {birthLocation.longitude}</div> | |
<div>Loc height: {birthLocation.height}</div> | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment