Skip to content

Cached template strings causes issues with escaped strings #16

@varsis

Description

@varsis

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions