score:0
you have a curried function there (it takes multiple sets of arguments). in your case data
and event
.
you can invoke it like this with both particular sets of arguments at once: handleportfoliochange(data)(event)
(instead of handleportofoliochange(data,e)
).
maybe it's of help to mention that you can also define a more narrow function with a particular data object to use every time to only have to vary the event like this:
//say, you had data-object that doesn't change in this scope like constantdata
constantdata = {
"some": 1,
"data": 2,
"here": "idk"
}
// then you could define a more particular function that handleportfoliochange, by passing //only the first argument to the general function:
handleconstantportfoliodata = handleportfoliodata(constantdata);
you could then invoke it anywhere but only worry about the event:
...onchange={e => this.handleconstantportfoliodata(e)}...
Source: stackoverflow.com
Related Query
- React - uncaught TypeError: Cannot read property 'setState' of undefined
- react router v^4.0.0 Uncaught TypeError: Cannot read property 'location' of undefined
- React with ES7: Uncaught TypeError: Cannot read property 'state' of undefined
- Uncaught TypeError: Cannot read property 'push' of undefined (React-Router-Dom)
- React-Router - Uncaught TypeError: Cannot read property 'getCurrentLocation' of undefined
- Uncaught TypeError: Cannot read property 'props' of null
- TypeError when using React: Cannot read property 'firstChild' of undefined
- Uncaught (in promise) TypeError: Cannot read property 'createElement' of undefined(…)
- Uncaught TypeError: Cannot read property 'call' of undefined at __webpack_require__
- Uncaught TypeError: Cannot read property 'state' of null in react
- react-router Uncaught TypeError: Cannot read property 'toUpperCase' of undefined
- Uncaught TypeError: Cannot read property 'bool' of undefined after upgrade reactjs
- Uncaught TypeError: Cannot assign to read only property '' of object '#<Object>'
- Uncaught TypeError: Cannot read property 'injection' of undefined
- Uncaught TypeError: Cannot read property '__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' of undefined
- Uncaught (in promise) TypeError: Cannot read property 'setState' of undefined
- Uncaught TypeError: Cannot read property 'state or props' of undefined
- Uncaught TypeError: Cannot read property 'type' of undefined at start of switch function
- Webpack Uncaught TypeError: Cannot read property 'call' of undefined
- React-Router - Uncaught TypeError: Cannot read property 'route' of undefined
- Uncaught TypeError: Cannot read property 'data' of undefined with Gatsby and graphQl
- Uncaught TypeError: Cannot read property 'toUpperCase' of undefined react state item
- Uncaught TypeError: Cannot read property 'hasOwnProperty' of undefined react-dom.production.min.js:760
- D3 pie chart: Uncaught Type Error - Cannot read property 'pie' of undefined
- React - Uncaught TypeError: Cannot read property 'func' of undefined
- Uncaught TypeError: Cannot read property 'func' of undefined in reactjs
- Uncaught TypeError: Cannot read property 'value' of undefined in REACT JS
- React tutorial: Uncaught TypeError: Cannot read property 'data' of null
- Uncaught type error: cannot read property persist of undefined with react-bootstrap carousel
- React: Uncaught TypeError: Cannot read property '_currentElement' of null
More Query from same tag
- React re-exporting components failed
- Using React Hooks, how do I make a reusable component and parent component that utilize each other?
- React how can i use @import
- Closing a list item dropdown on selecting an item or clicking outside it
- Environmental variables are undefined in react
- React Redux: Uncaught Invariant Violation (Objects are not valid as a React child)
- Mapping within a map in ReactJS
- Toggle Class based on scroll React JS
- Store default values from form in state when user doesen't change the default value
- Uncaught Error: Target container is not a DOM element
- How can I generate number from 0 to 100 using 'react-select'?
- Using angular 4 as a part of existing web application
- Sending data through axios post gives null data in mysql.Can anyone tell me what is the problem
- Can't override Fab disabled color material - ui
- How to update single value inside specific array item in redux
- React setState with arrays , how to auto create an array id without construct
- how can I simply pull the latest 10 tweets from the same user in javascript
- ReactJS reconciliation when a parent DOM node changes type
- Images are disappearing after refreshing the page in React
- Which is better way to pass data to event handler: by function closure or custom data-attribute
- How to display nested routes in different pages using React Hooks..?
- Getting .then of undefined when trying to test a dispatch action function in React/Redux/Jest
- How to show components conditionally based on route
- How to pass null as a field's initial value in react-final-form?
- Finding Maximum value in an Array of Objects by ReactJs
- GATSBY: TypeError: Cannot read property 'includes' of undefined
- React hooks dependencies, including it creates an infinite loop, not including it doesn't give me the latest value
- How to render DIV element with a button click on ReactJs
- How would I use setState for this particular example?
- Re-Render component React