wix-incubator/react-templates

what about escape of braces?

vipcxj opened this issue · 3 comments

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?

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;.

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.

@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.