Answer the question
In order to leave comments, you need to log in
Why is the webpack config not loading when using Next.js?
Hi everyone, I'm working with React/Redux/Next.js. First I created a React / Redux base, now I started integrating Next. Changed package.json :
"start": "webpack-dashboard -- webpack-dev-server --mode development --open --hot",
"start": "next",
import React from "react";
import App from "../src/containers/App";
const Index = ({}) => (
<div>
<App />
</div>
);
export default Index;
import React, { Component } from "react";
import { connect } from "react-redux";
import { initAction } from "../../actions/index";
import "./index.scss";
class App extends Component {
componentWillMount() {
const initActionData = {
hello: "world"
};
this.props.initAction(initActionData);
}
state = {
preview: "img/index.jpg"
};
render() {
const { preview } = this.state;
return (
<div className="preview" style={{backgroundImage: `url(${preview})`}} />
);
}
}
const mapDispatchToProps = {
initAction
};
const mapStateToProps = state => {
return {
init: state.init
};
};
export default connect(mapStateToProps, mapDispatchToProps)(App);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question