score:0
you are importing {createuser}
and trying to use {createuser}
in the container.jsx file.
score:0
you need to use mapdispatchtoprops
instead of matchdispatchtoprops
and also
use createuser
in you mapdispatchtoprops
function since you imported it as createuser
class createusercontainer extends component{
constructor(props) {
super(props);
}
componentdidmount(){
}
render (){
return(
<logincomponent createuser={this.props.createuser} />
)
}
}
function mapdispatchtoprops(dispatch){
return bindactioncreators({
createuser:createuser
}, dispatch)
}
also your class must implement the constructor to inherit the props
one more thing is that your handlesubmit function in logincomponent is not bound
class logincomponent extends component{
constructor(props) {
super(props);
this.handlesubmit = this.handlesubmit.bind(this);
}
you can also try and console.log(this.props)
in your logincomponent
to see if it receives the createuser
function
Source: stackoverflow.com
Related Query
- Reactjs, error send data to post with axios
- Post Data With Redux and Fetch API with Axios Get Error Result so Looping Response Pending
- axios post request to send form data in reactjs
- Upload and send data with axios in reactjs
- ReactJS axios POST request send all options as a single JSON key with empty value
- How to POST a JSON with data provided by user with REACTJS and Axios
- Want to send JWT token in headers along with data using axios but getting this error : Cannot set headers after they are sent to the client
- Node server is unable to process data send with axios get and returns different error than postman
- axios post request to send form data
- axios post request with json data
- react native post form data with object and file in it using axios
- How to send body data and headers with axios get request?
- Catch return json from POST with Axios when error 400 (Bad Request) occurs
- Axios Post Form with Reactjs
- react with Rails 5, getting CSRF error for post with axios
- How to send POST data to flask using Reactjs fetch
- React - Axios POST form data with files and strings
- axios doesn't send post data to the back-end
- Cannot send form data with axios when using interceptors
- Send JSON data as multipart/form-data using axios POST Request
- Error handling with axios requests in reactjs
- Delete data from API with Axios and ReactJS
- axios post request error with 422 (Unprocessable Entity) from react
- How to send data as string and not json on axios post
- Axios post does not send data
- Axios POST getting 500 (Internal Server Error) with ReactJS and Laravel Sanctum
- Error handling with POST signals from axios to Django Rest Server
- ReactJS axios POST call to PHP - Request Aborted error
- React axios post request does not send the data
- send file from formik reactjs to springboot using axios with saga
More Query from same tag
- How can I create a progress bar for an API request in React Native?
- How to handle props too slow to update?
- Use TypeScript props keys for function component props
- Update an object with useSelector
- Typescript, using a string to lookup an enum
- How to dynamically load module in react-native?
- How to validate field when rendering same field multiple time with different name id in redux form
- onScroll React cannot trigger
- React Redux: Reload the component from ACTION when the props change
- IdentityServer userinfo endpoint not requested after silent renew
- JSX get width of a div element
- react dropdown option elimination
- What will be called next after the mapStateToProps
- MultiSelect box popover keeps jumping when scroll or select items
- Accessing a functional component state from another functional component
- Object to array react
- State stays the same when using event listeners
- Nested array in object returns 'undefined' when accessing in JSX
- ReactJS - prevState in the new useState React hook?
- Cannot read property 'length' of undefined when trying to get # of objects
- React: disable a filtered item
- Fetching data error with useSWR, reactjs, nextjs
- React how to link child component onClick to parent state
- How do I make a Grid component clickable to check/uncheck checkbox?
- Yeoman angular automatic vendors JS not adding
- How to get Webpack Dev Server to display images stored locally?
- React - Modal with Confirm Deletion from array map
- How can I render different news components into the Navbar Component & display their data on the Navbar page, On Click of Navbar menu links
- Ternary operators test case with jest
- How to correctly make a get request during onChange