Skip to content

Instantly share code, notes, and snippets.

@vkbansal
Last active January 11, 2022 09:47
Show Gist options
  • Save vkbansal/284aa4e3dbaba950487258df75050165 to your computer and use it in GitHub Desktop.
Save vkbansal/284aa4e3dbaba950487258df75050165 to your computer and use it in GitHub Desktop.
string-ext-05
// index.tsx
import HomePage from "./HomePage";
import AboutPage from "./AboutPage";
import Nav from "./Nav";
+ import strings from "./strings.yaml";
+ import { StringsContextProvider } from "./StringsContext";
function App() {
return (
+ <StringsContextProvider data={strings}>
<div style={{ maxWidth: "500px" }}>
<Nav />
<Routes>
<Route path="/" element={<HomePage />} />
<Route path="/about" element={<AboutPage />} />
</Routes>
</div>
+ </StringsContextProvider>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment