Files
Sebastian MarkbågeandGitHub 274c980c53 Warn for useFormState on initial render (#30292)
This was missed in the mount dev dispatcher. It was only in the rerender
dispatcher which means that it was only logged during the rerender.
Since DevTools can hide logs during rerenders, this hid the warning in
StrictMode.
2024-07-08 16:45:24 -04:00

17 lines
366 B
JavaScript

'use client';
import * as React from 'react';
import Container from './Container.js';
export function Counter({incrementAction}) {
const [count, incrementFormAction] = React.useActionState(incrementAction, 0);
return (
<Container>
<form>
<button formAction={incrementFormAction}>Count: {count}</button>
</form>
</Container>
);
}