Skip to content
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 t.frag() to handle fragments #27

Merged
merged 1 commit into from Mar 24, 2020
Merged

Implement t.frag() to handle fragments #27

merged 1 commit into from Mar 24, 2020

Conversation

@sstur
Copy link
Member

sstur commented Mar 24, 2020

Boom. Advanced internationalization for all your international needs. Merge if you like it.

@sstur sstur requested a review from danielsukmana Mar 24, 2020
{t.frag('Symptoms may appear <b>2-14 days after exposure</b>', {
b: (content) => <Text weight="bold">{content}</Text>,
})}
Comment on lines +22 to +24

This comment has been minimized.

Copy link
@sstur

sstur Mar 24, 2020

Author Member

Note: you don't need to call this "b", you can call it anything you want but it needs to match the property in the object.

Copy link
Member

danielsukmana left a comment

Awesome!

// TODO: We should be able to infer this type by importing the
// real implementation, but I can't get that to work.
Comment on lines +4 to +5

This comment has been minimized.

Copy link
@danielsukmana

danielsukmana Mar 24, 2020

Member

I'll tinker with this

@sstur

This comment has been minimized.

Copy link
Member Author

sstur commented Mar 24, 2020

In a real (non-hackathon) implementation we'd probably want to wrap the array elements each in a fragment with a key. I don't know if React will complain about the key thing.

@sstur sstur merged commit 4e11879 into master Mar 24, 2020
1 check passed
1 check passed
build
Details
@sstur sstur deleted the frag branch Mar 24, 2020
Copy link
Contributor

darcien left a comment

I love this diff ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.