nest-next-starter icon indicating copy to clipboard operation
nest-next-starter copied to clipboard

Redux

Open kouji-dev opened this issue 5 years ago • 0 comments

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 (

{this.props.query}
); } }

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 ?

kouji-dev avatar May 12 '19 15:05 kouji-dev