Skip to content

Commit a23439f

Browse files
committed
Pass dynamicPropsId when calling client run
1 parent c3219de commit a23439f

File tree

1 file changed

+8
-0
lines changed
  • packages/connect-react/examples/nextjs/src/app

1 file changed

+8
-0
lines changed

packages/connect-react/examples/nextjs/src/app/page.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
ComponentFormContainer, FrontendClientProvider,
77
} from "@pipedream/connect-react";
88
import { fetchToken } from "./actions";
9+
import {DynamicProps} from "../../../../src";
910

1011
export default function Home() {
1112
const userId = "my-authed-user-id";
@@ -21,6 +22,11 @@ export default function Home() {
2122
text: "hello slack!",
2223
});
2324

25+
const [
26+
dynamicProps,
27+
setDynamicProps,
28+
] = useState<DynamicProps<any>>();
29+
2430
return (
2531
<>
2632
<div>My application</div>
@@ -29,13 +35,15 @@ export default function Home() {
2935
userId={userId}
3036
componentKey="slack-send-message"
3137
configuredProps={configuredProps}
38+
onUpdateDynamicProps={setDynamicProps}
3239
onUpdateConfiguredProps={setConfiguredProps}
3340
onSubmit={async () => {
3441
try {
3542
await client.actionRun({
3643
userId,
3744
actionId: "slack-send-message",
3845
configuredProps,
46+
dynamicPropsId: dynamicProps?.id
3947
});
4048
} catch (error) {
4149
console.error("Action run failed:", error);

0 commit comments

Comments
 (0)