wix-incubator / react-templates

Light weight templates for react
https://wix.github.io/react-templates
MIT License
2.82k stars 207 forks source link

what about escape of braces? #221

Open vipcxj opened 7 years ago

vipcxj commented 7 years ago

In the playground, I enter brace in the templates code, and it reports 'Failed to parse text '{''. So is there a way to escape brace?

nippur72 commented 7 years ago

It's ugly but there's a workaround:

<div>{'\u007b'} hello {'\u007d'}</div>

I don't remember if there's an issue open, but react-templates should parse html-entities correctly. If it did, it would have been as simple as &#123;.

vipcxj commented 7 years ago

Thanks for the rapid reply. By the way, is any way to track the build of the ast tree, and do some custom operations on the react dom tree created.

nippur72 commented 7 years ago

@vipcxj can you make an example? what do you need to achieve?

Some time ago I proposed a pluggable architecture (see #178) but the PR is still on hold.

I have also written a plugin-like for webpack, see react-templates-preprocess-loader.