Created
July 5, 2020 07:37
-
-
Save rehrumesh/a507d7e62f81e585d61b85baca31ceab 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"; | |
export default function GreetingCat(props) { | |
const { greeting } = props.match.params; | |
const greetingCatUrl = `https://cataas.com/cat/says/${greeting}`; | |
return ( | |
<div> | |
<header> | |
<h3>Greet me</h3> | |
{!greeting ? ( | |
<div>Needs a greeting</div> | |
) : ( | |
<div> | |
<img src={greetingCatUrl} width="400px" alt="Cat" /> | |
</div> | |
)} | |
</header> | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment