-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Biz/dj 2788 google sheets submission doesnt work #15179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
8a4661b
d6a99e7
c3219de
a23439f
e7863c4
1544552
391c99d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ import { | |
| ComponentFormContainer, FrontendClientProvider, | ||
| } from "@pipedream/connect-react"; | ||
| import { fetchToken } from "./actions"; | ||
| import { DynamicProps } from "../../../../src"; | ||
|
|
||
| export default function Home() { | ||
| const userId = "my-authed-user-id"; | ||
|
|
@@ -21,6 +22,11 @@ export default function Home() { | |
| text: "hello slack!", | ||
| }); | ||
|
|
||
| const [ | ||
| dynamicProps, | ||
| setDynamicProps, | ||
| ] = useState<DynamicProps<{}>>(); | ||
|
|
||
| return ( | ||
| <> | ||
| <div>My application</div> | ||
|
|
@@ -29,13 +35,15 @@ export default function Home() { | |
| userId={userId} | ||
| componentKey="slack-send-message" | ||
| configuredProps={configuredProps} | ||
| onUpdateDynamicProps={setDynamicProps} | ||
| onUpdateConfiguredProps={setConfiguredProps} | ||
| onSubmit={async () => { | ||
| try { | ||
| await client.actionRun({ | ||
| userId, | ||
| actionId: "slack-send-message", | ||
| configuredProps, | ||
| dynamicPropsId: dynamicProps?.id, | ||
|
||
| }); | ||
| } catch (error) { | ||
| console.error("Action run failed:", error); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improve type safety for dynamic props.
The empty object type
{}is not type-safe and allows any non-nullish value. This could lead to runtime errors if the dynamic props have a specific expected shape.Consider one of these approaches:
🧰 Tools
🪛 Biome (1.9.4)
[error] 28-28: Don't use '{}' as a type.
Prefer explicitly define the object shape. '{}' means "any non-nullable value".
(lint/complexity/noBannedTypes)
🪛 eslint
[error] 28-28: The
{}("empty object") type allows any non-nullish value, including literals like0and"".objectinstead.unknowninstead.(@typescript-eslint/no-empty-object-type)
🪛 GitHub Actions: Pull Request Checks
[error] 28-28: The
{}("empty object") type is not allowed. Consider usingobjectfor "any object" orunknownfor "any value" instead.