Skip to content
Advertisement

Attempted import error: ‘getMoviesList’ is not exported from ‘./actions’; error in react redux

I’m trying to import a function ‘getMoviesList’ written in action/index.js but getting an error even though my code and paths are correct Please have a look on my App.js ( where I’m trying to import that function ) and ./action/index.js ( where I have defined that function )

App.js

JavaScript

action/index.js

JavaScript

Advertisement

Answer

change import { getMoviesList } from './actions'; to import getMoviesList from './actions'; as getMoviesList function is exported as default. As a result, it should be imported without using curly braces.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement