Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Try to handle React's streaming renderer yielding at inopportune times #2413
Added a test for interleaveWithNodeStream. The niche case where the
Hello styled-components maintainers, thank you for this useful CSS-in-JS library! It's been super useful for my projects so far
I have come across a very odd issue that I think is worth addressing
Very rarely, the chunks generated by react renderToNodeStream will have one chunk end with the opening tag and contents of a textarea, and the next chunk will start with the closing tag of the textarea. Combined with styled-components interleaveWithNodeStream, prepending the <style> tags to the chunk causes an issue specifically with textareas in this case. For any other elements, this has not caused an issue, since a style tag as a child of another tag typically just inserts the style tag into the DOM. However, textareas are an exception, as any children of a textarea will be interpreted as a string, and rendered as the initial textArea text, rather than being rendered as HTML node into the DOM.
I've created the following test to reproduce the issue, let me know if I can help further or provide further information. Many thanks!