kodyl / react-document-meta

HTML meta tags for React-based apps. Works for both client- and server-side rendering, and has a strict but flexible API.
MIT License
321 stars 23 forks source link

'clone' bug: not all props can be serialized #10

Closed necolas closed 8 years ago

necolas commented 8 years ago

The library claims to support the following useful pattern (see document-title):

<DocumentMeta>
  <Component />
</DocumentMeta>

Otherwise you're required to add a wrapping element and handle any styles it might need to help with layout, which is something I'd like to keep out of containers or routes.

<View>
  <DocumentMeta />
  <Component />
</View>

While there is some untested code in place to support this, we (Twitter) encountered a bug that arises from the JSON parse/stringify (your clone util) of props that contain unserializable data, e.g., Symbols or functions. I believe the current approach to cloning should collect only the props you're interested in.

danieljuhl commented 8 years ago

I'll have a look at this issue, this weekend...

danieljuhl commented 8 years ago

Should be fixed in 2.0.1

necolas commented 8 years ago

Thank you!