diff --git a/.github/workflows/nx-affected-e2e.yml b/.github/workflows/nx-affected-e2e.yml index ef1abd2d1..426e9c494 100644 --- a/.github/workflows/nx-affected-e2e.yml +++ b/.github/workflows/nx-affected-e2e.yml @@ -27,6 +27,7 @@ jobs: run: yarn affected:e2e env: E2E_NEXTJS_SERVER_KEY: ${{ secrets.E2E_NEXTJS_SERVER_KEY }} + NEXT_PUBLIC_E2E_NEXTJS_KEY: ${{ secrets.NEXT_PUBLIC_E2E_NEXTJS_CLIENT_KEY }} NEXT_PUBLIC_E2E_NEXTJS_CLIENT_KEY: ${{ secrets.NEXT_PUBLIC_E2E_NEXTJS_CLIENT_KEY }} DVC_E2E_SERVER_SDK_KEY: ${{ secrets.DVC_E2E_SERVER_SDK_KEY }} - name: Upload Playwright Report diff --git a/sdk/react/src/withDevCycleProvider.tsx b/sdk/react/src/withDevCycleProvider.tsx index 36dc6b4d7..942dbbdbc 100644 --- a/sdk/react/src/withDevCycleProvider.tsx +++ b/sdk/react/src/withDevCycleProvider.tsx @@ -1,25 +1,32 @@ import { ProviderConfig } from './types' -import React from 'react' +import React, { + forwardRef, + ForwardRefExoticComponent, + PropsWithoutRef, + RefAttributes, +} from 'react' import hoistNonReactStatics from 'hoist-non-react-statics' import { DevCycleProvider } from './DevCycleProvider' -export function withDevCycleProvider( - config: ProviderConfig, -): (WrappedComponent: React.ComponentType) => React.ComponentType { - return (WrappedComponent) => { - const HoistedComponent = (props: T) => { +export const withDevCycleProvider = + (config: ProviderConfig) => + ( + WrappedComponent: React.ComponentType, + ): ForwardRefExoticComponent< + PropsWithoutRef & RefAttributes + > => { + const HoistedComponent = forwardRef((props: T, ref) => { return ( - + ) - } + }) hoistNonReactStatics(HoistedComponent, WrappedComponent) return HoistedComponent } -} /** * @deprecated Use withDevCycleProvider instead