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

Cached template strings causes issues with escaped strings #16

Open
varsis opened this issue Mar 24, 2017 · 1 comment
Open

Cached template strings causes issues with escaped strings #16

varsis opened this issue Mar 24, 2017 · 1 comment

Comments

@varsis
Copy link

varsis commented Mar 24, 2017

When using the cache on a particular component the cache causes the server to return some unexpected behaviour.

example: const MyComponent = (props) => (<div>{props.name}</div>)

MyComponent: {
  templateAttrs: ['name']
}

Now on the server side, I pass in something with a html equivalent value:
<MyComponent name={'My Name & name 2'} />

this gets put in the cache as something like: <div>${name}</div>

When MyComponent is pulled from the cache and string replaced, &amp; is placed instead of &.
The next time the component is rendered it returns &amp;amp; If caching is not enabled the problem is not present.

@maximenajim
Copy link
Contributor

@varsis are you able to reproduce this issue in a unit test? We haven't encountered this with our use of this library...

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

No branches or pull requests

2 participants