-
-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Hi there. I have a short story to test the library:
import { StoryFn } from "@storybook/react-vite";
import { createCallable } from "react-call";
export default {
title: "Dialog",
}
interface Props { message: string }
type Response = boolean
const MyDialog = createCallable<Props, Response>(({ call, message }) => {
return (
<div>
<p>{message}</p>
<button onClick={() => call.end(true)}>Yes</button>
<button onClick={() => call.end(false)}>No</button>
</div>
)
})
const Template: StoryFn = () => {
return (
<>
<button onClick={() => MyDialog.upsert({ message: new Date().toLocaleString() })}>Upsert Dialog</button >
<button onClick={() => MyDialog.end(false)}>End Dialog</button>
<MyDialog.Root />
</>
)
}
export const Primary: StoryFn = Template.bind({})
- When I click
Upsert Dialogbutton for the first time, the dialog is inserted as expected. - When I click
Upsert Dialogbutton for the second time, the dialog is updated as expexted. - When I click
End Dialogbutton, the dialog disappears as expected. - When I click
Upsert Dialogbutton for the third time, the dialog is not inserted.
What am I doing wrong? Thanks in advance.
flt3150sk and desko27
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working