Skip to content

Commit

Permalink
Fix our custom element serializer in IE11
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Aug 14, 2018
1 parent 8762d3e commit 52e1c10
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/element/src/serialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,11 +512,17 @@ export function renderElement( element, context, legacyContext = {} ) {

return renderElement( type( props, legacyContext ), context, legacyContext );
}

// React polyfills the symbol constants REACT_PROVIDER_TYPE and REACT_CONTEXT_TYPE
// using the 0xeacd and 0xeace numbers in IE11.
// See https://github.com/facebook/react/blob/master/packages/shared/ReactSymbols.js
switch ( type && type.$$typeof ) {
case REACT_PROVIDER_TYPE:
case 0xeacd:
return renderChildren( props.children, props.value, legacyContext );

case REACT_CONTEXT_TYPE:
case 0xeace:
return renderElement( props.children( context || type._currentValue ), context, legacyContext );
}

Expand Down

0 comments on commit 52e1c10

Please sign in to comment.