Created
January 11, 2022 10:09
-
-
Save vkbansal/ccff35436adb3f86400bbd12bd02ced8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 { useLocaleStrings, LocaleString } from "./StringsContext"; | |
export default function HomePage(): React.ReactElement { | |
const { getString } = useLocaleStrings(); | |
return ( | |
<div> | |
<h1>Home</h1> | |
- <p>{getString("homePageContent.para1")}</p> | |
+ <p>{getString("homePageContent.para1", { name: "John Doe 1" })}</p> | |
- <LocaleString strKey="homePageContent.para2" as="p" /> | |
+ <LocaleString | |
+ strKey="homePageContent.para2" | |
+ as="p" | |
+ variables={{ name: "World!" }} | |
+ /> | |
<p> | |
Lorem ipsum dolor sit amet consectetur adipisicing elit. Explicabo | |
optio, fuga cum velit corporis ipsam labore saepe assumenda inventore | |
nobis. Laboriosam, cumque blanditiis minima accusantium inventore | |
mollitia dolor optio exercitationem? | |
</p> | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment