I'm trying to override another react repo and am having issues doing so.
Issue 1) I want to override their method
selectItem = (item, clickType, e) => {
...
}
However, project can't compile code with the above syntax which I am trying to override.
Issue 2) What is the difference between the above and using :
selectItem(item, clickType, e){
...
}
If selectItem(item, clickType, e) overrides without using the "=" and "=> notation, I should also be good to go, but it doesn't look like my code is taking (if I setup a "debugger" in an override constructor that is taking so I already know I am instantiating the correct class).
I am under the impression that either way to override the function would be fine.
I was thinking that the Issue #1 involves webpack.config issues. I'm using:
loaders: [
{
test: /.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['es2015', 'react']
}
},
{ test: /\.css$/, loader: 'style-loader!css-loader' },
]
and the repo I'm looking at is using:
loaders: [
{
test: /\.css$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader')
},
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!sass-loader')
},
{
test: /\.(js|jsx)$/,
loaders: ['babel'],
exclude: /node_modules/
}
]
They're using ExtractTextPlugin, but shouldn't matter because it's not for .js/.jsx, right?
I don't understand Issue #2 well enough to know where to start.