Skip to content

Commit

Permalink
Update feature branch to account for React 18 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Aug 3, 2023
1 parent c83abe1 commit e64f745
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* Side Public License, v 1.
*/

import React, { PropsWithChildren } from 'react';
import { renderHook } from '@testing-library/react-hooks';
import React, { FunctionComponent, PropsWithChildren } from 'react';
import { renderHook } from '../../../test/rtl';

import {
EuiComponentDefaultsProvider,
Expand All @@ -18,7 +18,7 @@ import {
describe('EuiComponentDefaultsProvider', () => {
describe('useComponentDefaults', () => {
it('allows accessing provided `componentDefaults` from anywhere', () => {
const wrapper = ({ children }: PropsWithChildren<{}>) => (
const wrapper: FunctionComponent<PropsWithChildren> = ({ children }) => (
<EuiComponentDefaultsProvider
componentDefaults={{
EuiPortal: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import React, {
useContext,
useMemo,
FunctionComponent,
PropsWithChildren,
} from 'react';

import type { EuiPortalProps } from '../../portal';
Expand Down Expand Up @@ -50,9 +51,11 @@ export const EuiComponentDefaultsContext =
/*
* Component
*/
export const EuiComponentDefaultsProvider: FunctionComponent<{
componentDefaults?: EuiComponentDefaults;
}> = ({ componentDefaults = emptyDefaults, children }) => {
export const EuiComponentDefaultsProvider: FunctionComponent<
PropsWithChildren & {
componentDefaults?: EuiComponentDefaults;
}
> = ({ componentDefaults = emptyDefaults, children }) => {
return (
<EuiComponentDefaultsContext.Provider value={componentDefaults}>
{children}
Expand Down

0 comments on commit e64f745

Please sign in to comment.