I've built a wrapper package for drag and drop in React, and I added storybook
examples.
Since in my consumer React is exposed globally, i'm not importing React
explicitly.
In the storybook
examples I need to supply React
as part of the custom webpack config, but for some reason it can't resolve React
and I get a ReferenceError: React is not defined
This is the package - https://github.com/fiverr/drag_n_drop_package
And this is the custom webpack config file:
const webpack = require('webpack');
module.exports = {
plugins: [
new webpack.ProvidePlugin({
React: 'react'
})
],
module: {
loaders: [
{
test: /\.scss$/,
loader: 'style!raw!sass'
}
]
}
};