Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useSetState - doesnt support optional callback parameter #6256

Closed
1 of 2 tasks
atumas-bananamilk opened this issue May 18, 2024 · 0 comments
Closed
1 of 2 tasks

useSetState - doesnt support optional callback parameter #6256

atumas-bananamilk opened this issue May 18, 2024 · 0 comments

Comments

@atumas-bananamilk
Copy link

Dependencies check up

  • I have verified that I use latest version of all @mantine/* packages

What version of @mantine/* packages do you have in package.json?

7.9.2

What package has an issue?

@mantine/core

What framework do you use?

Next.js

In which browsers you can reproduce the issue?

None

Describe the bug

In React, useState also allows for optional callback function:

this.setState(
  {newState: 'whatever'},
  () => {/*do something after the state has been updated*/}
)

In some cases this is needed instead of using useEffect.

Now, when using useSetState from Mantine (https://mantine.dev/hooks/use-set-state/), it doesn't support callback functions. Can we get such feature implemented?

If possible, include a link to a codesandbox with a minimal reproduction

No response

Possible fix

No response

Self-service

  • I would be willing to implement a fix for this issue
@mantinedev mantinedev locked and limited conversation to collaborators May 23, 2024
@rtivital rtivital converted this issue into discussion #6276 May 23, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant