Skip to content

Commit

Permalink
Update Tooltip to use default argument
Browse files Browse the repository at this point in the history
  • Loading branch information
wooferzfg committed May 5, 2024
1 parent 79b6b6c commit 6f8056c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .eslintrc
Expand Up @@ -23,6 +23,9 @@
"no-underscore-dangle": "off",
"valid-jsdoc": ["error", {
"requireReturn": false
}],
"react/require-default-props": ["error", {
"functions": "defaultArguments"
}]
},
"settings": {
Expand Down
6 changes: 1 addition & 5 deletions src/ui/tooltip.jsx
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import React, { useId } from 'react';
import { Tooltip as ReactTooltip } from 'react-tooltip';

function Tooltip({ children, tooltipContent }) {
function Tooltip({ children, tooltipContent = null }) {
if (_.isNil(tooltipContent)) {
return children;
}
Expand All @@ -28,10 +28,6 @@ function Tooltip({ children, tooltipContent }) {
);
}

Tooltip.defaultProps = {
tooltipContent: null,
};

Tooltip.propTypes = {
children: PropTypes.element.isRequired,
tooltipContent: PropTypes.node,
Expand Down

0 comments on commit 6f8056c

Please sign in to comment.