Skip to content
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

[BUG] - Updating the state does not trigger visual changes in the Nextui components #4407

Open
metebtg opened this issue Dec 19, 2024 · 2 comments

Comments

@metebtg
Copy link

metebtg commented Dec 19, 2024

NextUI Version

2.6.8

Describe the bug

State updates do not trigger visual updates. See the code example below.

But this example is just one thing; it also occurs in other components. State changes trigger visual updates in components placed in endContent or startContent. But NextUI components are not updated after state changes.

This started happening after I updated my NextJS to version 15 and React & React Dom to version 19, and also updated my NextUI to the latest version.

But the errors seem to be related to the NextJS or React updates. Because at the moment I have downgraded my NextJS version to 14 and React & React Dom to 18, but keep NextUI at latest version and it works fine.

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

The following code does not trigger a visual refresh, even though the pending variable has changed

import { Button, ButtonProps } from "@nextui-org/button";

export default function FormButton(props: ButtonProps) {
	const { pending } = useFormStatus();

	return (
		<Button
			type="submit"
			isLoading={pending}
			isDisabled={pending}
			spinnerPlacement={"end"}
			{...props}
		/>
	);
}

Expected behavior

However, the following code will trigger visual updates as expected

import { Button, ButtonProps } from "@nextui-org/button";
import { Spinner } from "@nextui-org/react";

export default function FormButton(props: ButtonProps) {
	const { pending } = useFormStatus();

	return (
		<Button
			type="submit"
			endContent={pending && <Spinner size="sm" color="current" />}
			{...props}
		/>
	);
}

Screenshots or Videos

No response

Operating System Version

Linux

Browser

Chrome

@wingkwong
Copy link
Member

please provide a sandbox for us to investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants