Skip to content

SWRMutationConfiguration.optimisticData types is not correct #4161

@SafelandingF

Description

@SafelandingF

Bug report

SWRMutationConfiguration.optimisticData types is not correct

Description / Observed Behavior

What kind of issues did you encounter with SWR?

the optimisticData Fn has a second injected parameter

Expected Behavior

How did you expect SWR to behave here?

its types should be same as useSWR's MutatorOptions

Repro Steps / Code Example

just log it , b is not undefined
optimisticData: (a, b, c) => { console.log("fnData", a.preferences, b.preferences, c); ... });

Additional Context

SWR version. the latest

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions