Skip to content

Commit

Permalink
Fix enzyme_helpers type issue
Browse files Browse the repository at this point in the history
  • Loading branch information
brianseeders committed Dec 9, 2021
1 parent 2872a20 commit da33a3a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/kbn-test/src/jest/utils/enzyme_helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ function getOptions(context = {}, childContextTypes = {}, props = {}) {
/**
* When using @kbn/i18n `injectI18n` on components, props.intl is required.
*/
function nodeWithIntlProp<T>(node: ReactElement<T>): ReactElement<T & { intl: InjectedIntl }> {
// This function is exported solely to fix the types output in TS 4.5.2, likely a bug
export function nodeWithIntlProp<T>(
node: ReactElement<T>
): ReactElement<T & { intl: InjectedIntl }> {
return React.cloneElement<any>(node, { intl });
}

Expand Down

0 comments on commit da33a3a

Please sign in to comment.