nest-next-starter
nest-next-starter copied to clipboard
Redux
Im struggling to add redux into my app, im trying to integrate https://www.npmjs.com/package/next-redux-saga but it sais that
The default export is not a React Component in page: "/views/Index"
here is my component :
`import React from 'react'; import { connect } from 'react-redux' import {CounterActionsType} from '../../store/actions/counter';
interface InitialProps { query: string; }
interface Props extends InitialProps {}
class Index extends React.Component<Props> { public static getInitialProps({ query }: InitialProps) { return { query }; } public render() { return (
const mapStateToProps = (state: any) => { return { value: state.counter, }; }
const mapDispatchToProps = (dispatch: any) => { return { onClick: () => { dispatch({ type: CounterActionsType.Increment, }); } } }
export default connect(mapStateToProps,mapDispatchToProps)(Index);`
the config of redux is the same as the next-redux-saga repo
is there a way to add redux to your config ?