score:14
What you could do (what I did in my case, at least) was what was pointed out in this link. Currently, you seem only to output the OwnerId
string to the generator and this shouldn't work like it is, as the generator there basically takes the arguments dispatched, an object with the type and the rest of the arguments sent to the dispatcher. The "correct" way to do would be to have a type definition that encompasses the type, with something like:
type Params = { OwnerId: string, type: string }
export function* getListEventsByUserSaga({ OwnerId }: Params) {
...
}
score:0
instead of
export function* getListEventsByUserSaga(action: { payload: any; }) {
...
//logic
...
}
use this
export function* getListEventsByUserSaga(action: any) {
...
//logic
...
}
it works for me
score:5
In your getListEventsByUserSaga generator, you are declaring the action as {OwnerId:string}
without a type. If you try to declare it with a type, this will get rid of the error. You can use ReturnType.
export function* getListEventsByUserSaga({OwnerId} : ReturnType<typeof fetchMyEventsListUserLoad>) {
try {
// code
} catch (error) {
// code
}
}
Source: stackoverflow.com
Related Query
- React Typescript - Argument of type is not assignable to parameter of type
- Argument of type 'HTMLElement | null' is not assignable to parameter of type 'Element'. Type 'null' is not assignable to type 'Element'.ts(2345)
- Argument of type 'unknown' is not assignable to parameter of type '{}'
- Argument of type 'Element' is not assignable to parameter of type 'ReactElement<any>
- react usestate hooks error: argument of type 'yyy' is not assignable to parameter of type 'setstateaction<xx>'
- getting error : Argument of type '() => () => boolean' is not assignable to parameter of type 'EffectCallback'
- Typescript React/Redux : Argument of type 'typeof MyClass' is not assignable to parameter of type 'ComponentType<...'
- React with Typescript: Argument of type 'never[]' is not assignable to parameter of type 'StateProperties | (() => StateProperties)'
- Argument of type '"MY_EVENTS_LOAD"' is not assignable to parameter of type 'TakeableChannel<unknown>' in yeild takeLatest
- React TypeScript: Argument is not assignable to parameter of type 'never'
- Argument of type 'string' is not assignable to parameter of type '`${string}` | `${string}.${string}` | `${string}.${number}`'
- Argument of type '(dispatch: Dispatch) => void' is not assignable to parameter of type 'AnyAction'
- Argument of type partial is not assignable to parameter of type
- Argument of type 'Date | null' is not assignable to parameter of type 'SetStateAction<Date>'
- React Typescript: Argument of type '{ [x: number]: any; }' is not assignable to parameter of type
- Argument of type 'number' is not assignable to parameter of type 'never' in array.includes()
- Argument of type 'string | null' is not assignable to parameter of type 'ValueFn<SVGPathElement, Datum[], string | number | boolean | null>'
- Argument of type '() => () => Promise<void>' is not assignable to parameter of type 'EffectCallback'
- Getting an error Argument of type 'unknown' is not assignable to parameter of type 'Error | null'
- Redux Toolkit - Argument of type 'AsyncThunkAction<>' is not assignable to parameter of type 'AnyAction'
- React js Typescript Argument of type 'string' is not assignable to parameter of type 'SetStateAction<number>'
- Argument of type 'Element[]' is not assignable to parameter of type 'Element'
- Redux - createStore. Argument of type is not assignable to parameter of type 'DeepPartial<any>'
- Argument of type 'AsyncThunkAction<any, void, {}>' is not assignable to parameter of type 'AnyAction'
- TS2345: Argument of type 'ReactNode' is not assignable to parameter of type 'ReactElement'
- Argument of type 'string | undefined' is not assignable to parameter of type 'string'. Type 'undefined' is not assignable to type 'string'
- Argument of type 'typeof test' is not assignable to parameter of type 'Component<{ children?: ReactNode; } & DispatchProp<any>>'
- React onclick Argument of type 'EventTarget' is not assignable to parameter of type 'Node'
- TypeScript w/ React - Argument of type 'string' is not assignable to parameter of type 'keyof T'
- Argument of type 'Function' is not assignable to parameter of type 'ComponentType<never>'
More Query from same tag
- Uncaught ReferenceError: regeneratorRuntime is not defined in React
- How to play audio by clicking a specific button with onKeyDown on React?
- ReactJS, passing data between siblings
- How to stop jest running test constants folder
- react js datatables net, can't add custom html element to datatable columns
- React-router HashRouter When redirecting root URL with query parameters, route gets appended after params
- Complex async flow that failed to execute as expected
- Empty array is shown as object
- React how not to display if doing calculation inside jsx
- Insert a component when clicked and remove the componet when click other than that component
- Best practice for importing component from components library in React.js
- Include JSON files into React build
- How do I prevent empty values in my search bar, in React?
- Correct way to use CSSTransitionGroup and Redux Connect
- Graphql, react-apollo how to transfer variable to query at loading component state
- Waiting until function returns a value before proceeding in ReactJS
- React-ckeditor5 : CKEditorError: datacontroller-set-non-existent-root: Attempting to set data on a non-existing root
- Why is useRef not working to reference a canvas element?
- javascript regex [-_.] not first character
- React Memory Leak Although i return a clearinterval?
- (React) Margin auto not working for my pagination bar
- How to create global state with React Hooks [TypeScript]
- Change the data name in json
- React - Updating parameters for function calls by taking data from one component and passing it to the next is lagging by one step
- Axios in React for storing response for future use
- Objects are not valid as a React child (found: [object Promise]). If you meant to render a collection of children, use an array instead
- React--Looping through a json file, filtering based on a property, and grabbing another property if that condition is met
- The filter is not deleting each item in array while clicking on button. please assist
- React: Using State to change the appearance of a circle component when a button component is pressed
- Is it ok to pass the entire Redux state object into a React component?