import React from 'react'

const wrapWithContext = (context, contextTypes, children) => {
  const wrapperWithContext = React.createClass({
    childContextTypes: contextTypes,
    getChildContext() {
      return context
    },
    render() {
      return children
    }
  })
  return React.createElement(wrapperWithContext)
}

export default wrapWithContext

@@ -86,22 +86,22 @@
 =%3E %7B%0A  c
-onst w
+lass W
 rapperWi
@@ -114,166 +114,156 @@
 ext 
-= React.createClass(%7B%0A    childContextTypes: contextTypes,%0A    getChildContext() %7B%0A      return context%0A    %7D,%0A    render() %7B%0A      return children%0A    %7D%0A  %7D)
+extends React.Component %7B%0A    getChildContext = () =%3E context%0A    render = () =%3E children%0A  %7D%0A  WrapperWithContext.childContextTypes = contextTypes%0A
 %0A  r
@@ -288,17 +288,17 @@
 Element(
-w
+W
 rapperWi

Refactor wrapWithContext: no React.createClass