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

Insert tx-content attributes on components that need them #46

Merged
merged 1 commit into from Apr 24, 2017

Conversation

chrisgarrity
Copy link
Contributor

One of the gotchas for Transifex Live is that while most of the directives are through classes, there are a couple of things that use custom attributes (tx-content) which are stripped out by React. People have been asking for custom attributes on React since 2013 (facebook/react#140), and it actually looks like they may be getting around to adding them. In the meantime, I used what seemed like the recommended workaround from this comment: facebook/react#140 (comment).

I created TxDiv and TxSpan to wrap div and span components that need tx-content values.

I think it looks a bit messy, so I guess I'm wondering if this is the best way to do it. Or just live with it this way until react actually fixes 140.

Added TxDiv and TxSpan components to add `tx-content=…` to places that need it for Transifex Live.
Copy link
Contributor

@rschamp rschamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Looks like we'll probably get real custom attributes as a part of React 16!

@chrisgarrity chrisgarrity merged commit a6eb1ee into scratchfoundation:develop Apr 24, 2017
@chrisgarrity chrisgarrity deleted the tx-attr branch May 26, 2017 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants