Skip to content

Issue: Incorrect Usage of 'redux-thunk' Module #22

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
crazycodescat opened this issue Feb 1, 2024 · 1 comment
Open

Issue: Incorrect Usage of 'redux-thunk' Module #22

crazycodescat opened this issue Feb 1, 2024 · 1 comment

Comments

@crazycodescat
Copy link

**Issue: Incorrect Usage of 'redux-thunk' Module

Description:
When attempting to apply middleware in the Redux store configuration, an error is encountered due to incorrect usage of the 'redux-thunk' module. The code attempts to import the 'redux-thunk' middleware and apply it using the 'applyMiddleware' function. However, the error message indicates that the module does not export a member named 'default', leading to a SyntaxError during module import.**

Error:
import thunk from "redux-thunk";
^^^^^
SyntaxError: The requested module 'redux-thunk' does not provide an export named 'default'

**import thunk from "redux-thunk";

const store = createStore(
reducer,
applyMiddleware(logger.default, thunk.default)
);**

@sahilpatil-009
Copy link

import thunk like this >> import { thunk } from "redux-thunk"

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants