Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

dangerouslySetInnerHTML fails with arrays #100

Open
gcpantazis opened this issue Jun 16, 2017 · 0 comments
Open

dangerouslySetInnerHTML fails with arrays #100

gcpantazis opened this issue Jun 16, 2017 · 0 comments

Comments

@gcpantazis
Copy link

If you attempt to render a tag such as this:

<p dangerouslySetInnerHTML={{
		__html: content,
}}/>

where content is an array, Rapscallon will fail on the adler checksum generator:

/Users/gcp/Thumbtack/universal-frontend/node_modules/@thumbtack/rapscallion/lib/adler32.js:28
    b += a += data.charCodeAt(i);
                   ^

TypeError: data.charCodeAt is not a function

renderToString() allows for arrays, so it seems like we should handle them here. I can fix by specifying content[0] (all of the arrays I'm dealing with at the moment are 1-length), though I'd need to do some additional research to know exactly what React is expected to output when an array is provided.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants