Skip to content

Instantly share code, notes, and snippets.

@mitsuhiko
Created January 6, 2016 19:58
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mitsuhiko/70e3b000c2bc60c829dc to your computer and use it in GitHub Desktop.
Save mitsuhiko/70e3b000c2bc60c829dc to your computer and use it in GitHub Desktop.
function mark(rv) {
if (!LOCALE_DEBUG) {
return rv;
}
let proxy = {
$$typeof: Symbol.for('react.element'),
type: 'span',
key: null,
ref: null,
props: {
className: 'translation-wrapper',
children: typeof rv === 'array' ? rv : [rv]
},
_owner: null,
_store: {}
};
proxy.toString = function() {
return '🇦🇹' + rv + '🇦🇹';
};
return proxy;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment