Skip to content

Commit

Permalink
Refactor #2360 - For Tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Apr 2, 2022
1 parent 43686b4 commit 5b17276
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/lib/tooltip/Tooltip.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
import React, { forwardRef, memo, useEffect, useImperativeHandle, useRef, useState } from 'react';
import PrimeReact from '../api/Api';
import { Portal } from '../portal/Portal';
import { DomHandler, classNames, ZIndexUtils, ObjectUtils } from '../utils/Utils';
import { useMountEffect, useUpdateEffect, useUnmountEffect, useResizeListener, useOverlayScrollListener } from '../hooks/Hooks';

export const Tooltip = forwardRef((props, ref) => {
export const Tooltip = memo(forwardRef((props, ref) => {
const [visibleState, setVisibleState] = useState(false);
const [positionState, setPositionState] = useState(props.position);
const elementRef = useRef(null);
Expand Down Expand Up @@ -456,7 +456,7 @@ export const Tooltip = forwardRef((props, ref) => {
}

return null;
});
}));

Tooltip.defaultProps = {
__TYPE: 'Tooltip',
Expand Down

0 comments on commit 5b17276

Please sign in to comment.