Skip to content

Instantly share code, notes, and snippets.

@rehrumesh
Created July 5, 2020 07:37
Show Gist options
  • Save rehrumesh/a507d7e62f81e585d61b85baca31ceab to your computer and use it in GitHub Desktop.
Save rehrumesh/a507d7e62f81e585d61b85baca31ceab to your computer and use it in GitHub Desktop.
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