-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Trans component #18
base: master
Are you sure you want to change the base?
Conversation
React from 16.X to 18.X Webpack from 4.X to 5.X
Only for withLittera HOC that is suggested not to be used
Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
We have pushed a nightly release that includes the Trans component. To update run: |
+ Clean up code and dependencies
/reviewpad summarize |
Reviewpad Report
React from 16.X to 18.X
Only for withLittera HOC that is suggested not to be used' (50dfbba)
Fatal
|
📜 Description
This PR adds a new feature to the project: the Trans component. The Trans component is a custom translation component that can interpolate variables and parse HTML elements.
The Trans component takes three props:
children
- The translation string to be rendered.values
- An object containing values to be interpolated in the translation string.components
- An object containing custom React components or HTML tags to be parsed and rendered.This PR also includes an updated version of
package.json
.🧪 How to test this?
To test this PR, follow these steps:
trans-component
branch.yarn install
.yarn test
.yarn link
while in the root directory.npx create-react-app ./PlaygroundApp --template=typescript
yarn link @assembless/react-littera
while in the apps root directory.http://localhost:3000
to see the Trans component in action.🚀 Examples
Here are a few examples of how to use the Trans component: