Skip to content

Instantly share code, notes, and snippets.

@vkbansal
Created January 11, 2022 09:58
Show Gist options
  • Save vkbansal/057d643984054484a50af9b96f71a923 to your computer and use it in GitHub Desktop.
Save vkbansal/057d643984054484a50af9b96f71a923 to your computer and use it in GitHub Desktop.
// HomePage.tsx
import React from "react";
- import { useLocaleStrings } from "./StringsContext";
+ 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>
- Lorem ipsum dolor sit amet, consectetur adipisicing elit. Reprehenderit
- soluta aliquam sit aliquid qui possimus? Doloremque voluptatibus
- perferendis, quas laboriosam alias eum minus pariatur, temporibus ab
- sequi facilis eaque numquam.
- </p>
+ <LocaleString strKey="homePageContent.para2" as="p" />
<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