From a2c97bcae7ff7126cefd65ee2eb030e9a5231745 Mon Sep 17 00:00:00 2001 From: Keith Daulton Date: Wed, 16 Nov 2022 16:09:31 -0500 Subject: [PATCH] Updates FAST react wrapper --- src/webviews/apps/shared/components/helpers/react-wrapper.ts | 6 ++++++ src/webviews/apps/shared/components/overlays/react.tsx | 4 ++++ src/webviews/apps/shared/components/search/react.tsx | 7 ++----- 3 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 src/webviews/apps/shared/components/helpers/react-wrapper.ts create mode 100644 src/webviews/apps/shared/components/overlays/react.tsx diff --git a/src/webviews/apps/shared/components/helpers/react-wrapper.ts b/src/webviews/apps/shared/components/helpers/react-wrapper.ts new file mode 100644 index 0000000..891d14a --- /dev/null +++ b/src/webviews/apps/shared/components/helpers/react-wrapper.ts @@ -0,0 +1,6 @@ +import { provideReactWrapper } from '@microsoft/fast-react-wrapper'; +import React from 'react'; + +const { wrap } = provideReactWrapper(React); + +export { wrap as reactWrapper }; diff --git a/src/webviews/apps/shared/components/overlays/react.tsx b/src/webviews/apps/shared/components/overlays/react.tsx new file mode 100644 index 0000000..7d6fe10 --- /dev/null +++ b/src/webviews/apps/shared/components/overlays/react.tsx @@ -0,0 +1,4 @@ +import { reactWrapper } from '../helpers/react-wrapper'; +import { PopOver as PopOverComponent } from './pop-over'; + +export const PopOver = reactWrapper(PopOverComponent); diff --git a/src/webviews/apps/shared/components/search/react.tsx b/src/webviews/apps/shared/components/search/react.tsx index 46672ca..7bf8249 100644 --- a/src/webviews/apps/shared/components/search/react.tsx +++ b/src/webviews/apps/shared/components/search/react.tsx @@ -1,10 +1,7 @@ -import { provideReactWrapper } from '@microsoft/fast-react-wrapper'; -import React from 'react'; +import { reactWrapper } from '../helpers/react-wrapper'; import { SearchBox as searchBoxComponent } from './search-box'; -const { wrap } = provideReactWrapper(React); - -export const SearchBox = wrap(searchBoxComponent, { +export const SearchBox = reactWrapper(searchBoxComponent, { events: { onChange: 'change', onNavigate: 'navigate',