From 384148a7877febd712a4e825a3750ff142aff1bb Mon Sep 17 00:00:00 2001 From: Dane Pilcher Date: Thu, 16 Sep 2021 20:14:37 +0000 Subject: [PATCH] fix: only use useDataStoreBinding when predicate is set Resolves #84 --- .../studio-ui-codegen-react.test.ts.snap | 66 +++++++++++- .../__tests__/studio-ui-codegen-react.test.ts | 5 + .../dataBindingWithoutPredicate.json | 100 ++++++++++++++++++ .../lib/react-studio-template-renderer.ts | 23 ++-- tmp | 1 + 5 files changed, 177 insertions(+), 18 deletions(-) create mode 100644 packages/studio-ui-codegen-react/lib/__tests__/studio-ui-json/dataBindingWithoutPredicate.json create mode 100644 tmp diff --git a/packages/studio-ui-codegen-react/lib/__tests__/__snapshots__/studio-ui-codegen-react.test.ts.snap b/packages/studio-ui-codegen-react/lib/__tests__/__snapshots__/studio-ui-codegen-react.test.ts.snap index b27f512ee..647e9eb3d 100644 --- a/packages/studio-ui-codegen-react/lib/__tests__/__snapshots__/studio-ui-codegen-react.test.ts.snap +++ b/packages/studio-ui-codegen-react/lib/__tests__/__snapshots__/studio-ui-codegen-react.test.ts.snap @@ -215,11 +215,6 @@ export default function ComponentWithDataBinding( props: ComponentWithDataBindingProps ): JSX.Element { const { width, isDisabled, buttonUser, buttonColor } = props; - const { buttonUser } = useDataStoreBinding({ - type: \\"record\\", - model: User, - criteria: buttonUserFilter, - }); return (