score:0
your requestuser
action creator takes a user
object as an argument:
requestuser: (user: tuser) => ({
type: actiontypes.userrequested,
payload: { user },
}),
when switching to .ts
, typescript is able to detect function calls that are missing their required arguments. you are dispatching this requestuser
action creator from your saga without passing it a user
argument:
// typescript error: expected 1 arguments, but got 0. ts2554
yield put(actions.requestuser());
you have handled this correctly in your userrequested
/fulfilluser
saga where you access the user
object from getuserbytoken
and then pass it to your action creator. you will need to do the same or similar in your loginsaga
and registersaga
in order to call actions.requestuser
properly.
Source: stackoverflow.com
Related Query
- Problem with metronic react theme to typescript
- How to use Material UI custom theme in React with Typescript
- React & Material-UI: Theme undefined in createStyles() with TypeScript
- React with Typescript EventHandler type checking problem (onClick)
- React useContext problem with Typescript -- any alternative to <Partial>?
- React Typescript Problem with injected props
- Problem with splitting one component into smaller ones React and TypeScript
- I've problem with react typescript code in .tsx file
- Problem accessing nested data from a GraphQL query in React with TypeScript
- How to use refs in React with Typescript
- Set types on useState React Hook with TypeScript
- How to specify (optional) default props with TypeScript for stateless, functional React components?
- Cannot find namespace 'ctx' error when creating Context with react - typescript
- Using state in react with TypeScript
- React with Typescript -- Generics while using React.forwardRef
- React with Typescript - Type { } is missing the following properties from type
- React - useRef with TypeScript and functional component
- React with TypeScript - define defaultProps in stateless function
- Typescript and React setting initial state with empty typed array
- React prop types with TypeScript - how to have a function type?
- Testing a React component with Enzyme. Typescript can't find instance methods
- Using React forwardRef with Typescript generic JSX arguments
- declaring a property in constructor with typescript react
- React hook useRef not working with styled-components and typescript
- Use CSS Modules in React components with Typescript built by webpack
- React event handlers with Typescript and JSX
- How to use React with Typescript and SASS
- Writing a React higher-order component with TypeScript
- Typescript with React - use HOC on a generic component class
- Getting Error: "All files must be modules when the '--isolatedModules' flag is provide" in React with TypeScript
More Query from same tag
- How do I set up an 'onKeyPress' handler on a <canvas> in react?
- Apply rowStyleClass to every row in PrimeReact DataTable
- redux-thunk dispatch does not work
- Material UI Autocomplete Chip onDelete Not Working
- Options how to give feedback to user of SPA website after AJAX calls
- Passing props in a child component using jest mount
- React Native: setState not updating immediately when logging in console
- Add Items to cart without the user logged in react.js and redux
- Recharts issue with gaps between Bars
- What is the preferred way of mutating a big state array in ReactJS?
- Unable to build ES6 version of my React App with webpack and babel-preset-env
- Cannot sort array of objects in react
- Yup 'notRequired' method doesn't seem to be working in my form validation
- React.js input cursor reset with async onChange handler
- Argument of type 'string | null' is not assignable to parameter of type 'ValueFn<SVGPathElement, Datum[], string | number | boolean | null>'
- Integrate Detox with Fastlane
- Scrollable drop down lists in react-bootstrap
- Enzyme's simulate() not changing output for onChange event
- i got error from console while making loginPage but i don't know what's wrong (React.js)
- Reducing React table rerendering
- Render a component within another in React
- Cannot add link and label inside an input element in reactjs
- Refresh same page without reloading - Reactjs
- conditional operator to setState
- Cannot read property '' of undefined (react)?
- Coordinates array from PolylineMeasure plugin (react leaflet)
- Return value from callback function in React
- React change state continuously with while
- reduce condition checking in jsx of react
- How to conditionally render wrapping components in React Router 4/5