valotas / preact-context

React new Context API for preact
Other
151 stars 8 forks source link

How to provide it to dependencies? #28

Closed jgillich closed 5 years ago

jgillich commented 5 years ago

I use react-bootstrap, which uses react.createContext:

TypeError: _react.default.createContext is not a function
    at Object.<anonymous> (/var/home/jgillich/Development/polyfresh/node_modules/react-bootstrap/lib/ThemeProvider.js:17:43)

Is there any way to fix these imports? I tried to play around with webpack resolve alias, but that didn't work. :( I do have an alias for react -> preact-compat though.

jgillich commented 5 years ago
import React from 'react'
import { createContext } from 'preact-context'
React.createContext = createContext