Skip to content

Commit

Permalink
use destructured imports
Browse files Browse the repository at this point in the history
  • Loading branch information
pgayvallet committed Nov 14, 2019
1 parent c869fea commit 912124c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/public/utils/mount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import React, { useEffect, useRef } from 'react';
import ReactDOM from 'react-dom';
import { render, unmountComponentAtNode } from 'react-dom';
import { I18nProvider } from '@kbn/i18n/react';
import { MountPoint } from '../types';

Expand All @@ -39,6 +39,6 @@ export const MountWrapper: React.FunctionComponent<{ mount: MountPoint }> = ({ m
export const mountReactNode = (component: React.ReactNode): MountPoint => (
element: HTMLElement
) => {
ReactDOM.render(<I18nProvider>{component}</I18nProvider>, element);
return () => ReactDOM.unmountComponentAtNode(element);
render(<I18nProvider>{component}</I18nProvider>, element);
return () => unmountComponentAtNode(element);
};

0 comments on commit 912124c

Please sign in to comment.