Skip to content

Commit 75d2ca0

Browse files
committed
feat: support & reloadState and advance button data binding
1 parent 3de7d0b commit 75d2ca0

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

src/content/docs/guides/forms/data-binding.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ Special props:
100100
- **innerText**: string - the text of the button (overides the children)
101101
- **innerHTML**: string - the HTML of the button (overides the children)
102102
- **remove**: boolean - remove the button from the HTML
103+
- **reset()**: function - reset the button to the initial state
104+
- **defaults**: any - the default state of the button
103105

104106
```astro
105107
---

src/content/docs/guides/forms/js-helpers.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ class FormsReact {
2525
};
2626
updateOneSearchParam(key: string, value?: string, status?: ValidRedirectStatus): void;
2727

28+
/**
29+
* Reload the page with the current state (BindForm) without client redirect. If that a POST request, buttons will not be invoked again.
30+
* @param immediate true by default - If true, will stop rendering all BindForm components and their children and immediately reload the page.
31+
*/
32+
reloadState(immediate: boolean = true): void;
33+
2834
// client side redirect
2935
redirectTimeoutSeconds(location: string, timeoutSec = 2): void;
3036

0 commit comments

Comments
 (0)