Skip to content

Instantly share code, notes, and snippets.

@itsmunim
Created July 6, 2018 06:23
Show Gist options
  • Select an option

  • Save itsmunim/83fa178ede7d4f4c9a854d6844e7bbab to your computer and use it in GitHub Desktop.

Select an option

Save itsmunim/83fa178ede7d4f4c9a854d6844e7bbab to your computer and use it in GitHub Desktop.
function Greeting({greeting}) {
return <h1>{greeting}</h1>;
}
class LanguageGreeting extends React.Component {
constructor(props) {
super(props);
this.fetchGreetingsInDifferentLanguages();
}
fetchGreetingsInDifferentLanguages() {
// Some network call to fetch all the greetings in different languages
}
render() {
return (<div>
{
this.languageGreetings.map(lG => <Greeting greeting={lG}></Greeting>);
}
</div>);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment