Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/connect-react/examples/nextjs/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ export default function Home() {
text: "hello slack!",
});

const [
dynamicPropsId,
setDynamicPropsId,
] = useState<string | undefined>();

const handleDynamicProps = (dynamicProps: { id: string | undefined }) => {
setDynamicPropsId(dynamicProps.id)
}

return (
<>
<div>My application</div>
Expand All @@ -29,13 +38,15 @@ export default function Home() {
userId={userId}
componentKey="slack-send-message"
configuredProps={configuredProps}
onUpdateDynamicProps={handleDynamicProps}
onUpdateConfiguredProps={setConfiguredProps}
onSubmit={async () => {
try {
await client.actionRun({
userId,
actionId: "slack-send-message",
configuredProps,
dynamicPropsId,
});
} catch (error) {
console.error("Action run failed:", error);
Expand Down
2 changes: 1 addition & 1 deletion packages/connect-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/connect-react",
"version": "1.0.0-preview.15",
"version": "1.0.0-preview.16",
"description": "Pipedream Connect library for React",
"files": [
"dist"
Expand Down
5 changes: 5 additions & 0 deletions packages/connect-react/src/hooks/form-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,17 @@ export const FormContextProvider = <T extends ConfigurableProps>({
configuredProps,
dynamicPropsId: dynamicProps?.id,
};
const queryKeyInput = {
...componentReloadPropsInput,
}

const {
isFetching: dynamicPropsQueryIsFetching,
// TODO error
} = useQuery({
queryKey: [
"dynamicProps",
queryKeyInput,
],
queryFn: async () => {
const { dynamicProps } = await client.componentReloadProps(componentReloadPropsInput);
Expand Down
Loading