score:0
because you used export default emailchanged
, you can't get the value of emailchanged
by destructing. remove the export default emailchanged
line in your index.js and you should be good.
score:0
because you have the wrong import.
replace:
import {emailchanged} from 'torusteensapp/src/actions';
with:
import emailchanged from 'torusteensapp/src/actions';
here's a better explanation: difference between "import {something} from somelib" and "import something from somelib" react.js
score:4
in your index.js
, you have exported the action emailchanged
as a named export and you are again exporting the same as default
. however you are only importing it as a named import. thats the reason for your error.
remove the default export for emailchanged
.
import {email_changed} from './types';
export const emailchanged = (text) => {
return {
type: 'email_changed',
payload: text
};
};
onemailchange = (text) => {
this.props.emailchanged(text);
};
however, i assume that your intension was to export default onemailchange
function.
in that case change add
export default onemailchange
to the index.js
file.
Source: stackoverflow.com
Related Query
- I keep getting this Server Error - Error: The default export is not a React Component in page: "/products/all"
- Prefer default export eslint error
- Why am I getting "potentially invalid reference access to a class field via this in a nested function" error
- Why I am getting this error - Error: EPERM: operation not permitted, mkdir 'C:\Users\Aniket' command not found: create-react-app
- Why is IE8 getting a script error when using Facebook's React.js
- Why I am getting this error message when I run react js project first time in my system?
- If 'React' is the default export from 'react', Why can't we use some other name instead of 'React'
- Why am I getting this error - 'You are calling withTheme(Component) with an undefined component.' -React JS
- Why am I getting "unused default export" error?
- Why am I getting the error message "Property 'then' does not exist on type 'AsyncThunkAction'"?
- Why am I getting this error (Tailwind + Next.js)? HookwebpackError, CssSyntaxError
- esModuleInterop flag set, still getting default import error
- Export default unused in WebStorm
- Why am I getting error while adding service in EmailJS?
- Why do we need default export in React?
- can anyone explain why i'm getting a map function error
- Why am I getting error TS2339 on querySelectorAll for checkbox property 'checked' does not exist
- Why am I getting "TypeError: react__WEBPACK_IMPORTED_MODULE_1___default.a.useState is not a function" error when using reactjs hooks?
- Getting error while creating production build 'does not contain a default export'
- Why am I getting the error "'CSS3DObject' is not exported from 'three'"?
- Why am I getting a 'no-unused-var' error when using in an inline function
- Why do I keep getting 404 error for Socket.io polling requests?
- Why do I keep on getting 'Received number of calls: 0' error in my React unit test?
- Why am I getting a jsx-loader error when I try to use react-router with webpack>
- Why am I getting error "No valid versions available for undefined" while installing create-react-app
- Why do I have to specify a default export twice in React?
- Why does typescript infer a default prop when we dynamically import a javascript file which does not have a default export
- Why am I getting a 500 error on form submit?
- Why am I getting the no exported member error in this React/Typescript app?
- Why am I getting Render Error undefined is not an object (evaluating 'listing.image')?
More Query from same tag
- How do I access properties of objects inside another object
- Send Image file along with other data to Java backend using React.JS
- How can I render sidebar depend on user
- how to use a CDN inside a React component
- redux state doesn't have updated value in InterSectionObserver callback function
- How to convert HOC to react component syntax for apollo?
- Translating React + Axios from Javascript > Typescript
- dynamic File inside folders not reading with React and preval.macro
- React and useState(): multiple re-renders if initial state is a string
- API data not appearing in component but shows in console
- react map leaflet circleMarker doesn't render
- React redux won't update class component's state
- Not able to import react-autosuggest module showing the error below
- Add pathPrefix to static image assets in Gatsby
- How to delete a list item from ant design List?
- Rollup error: could not load a module from @babel/runtime when importing a Material-UI component
- Query params in React Router
- how to apply Full screen striction in react js?
- Reactjs: problem converting <input type="file"> to custom button icon
- An error occurred when I get a data from firestore in React app
- Access props.location object from redux-saga
- can't set backgroundImage in react?
- React - File uploader button doesn't work properly
- How to use Ellipsis in react-bootstrap pagination
- Call a function on a ReactJs component class object
- ReactJs - List view with vertical lines. How to draw this?
- React Hooks - useState using the result of another hook var set during useEffect
- How to collapse Siblings with Headless UI
- How I can apply white color for Material UI Icon?
- opening a react select dropdown inside a div is pushing another div in the same parent