There was an error while loading. Please reload this page.
2 parents d4c70a6 + c968c91 commit c30eb3dCopy full SHA for c30eb3d
1 file changed
src/components/search/Searchbar/Form.tsx
@@ -58,7 +58,13 @@ export default function Searchbar(
58
const onSubmit = () => {
59
const term = inputRef.current?.value;
60
if (term) {
61
- window.DECO?.events.dispatch({
+ // `dispatch` exists at runtime (set up by the framework's DECO.events
62
+ // bootstrap), but @decocms/apps' ambient Window.DECO type only declares
63
+ // `subscribe`. Cast through the real shape to dispatch programmatically.
64
+ const events = window.DECO?.events as unknown as
65
+ | { dispatch?: (event: unknown) => void }
66
+ | undefined;
67
+ events?.dispatch?.({
68
name: "search",
69
params: { search_term: term },
70
});
0 commit comments