diff --git a/src/components/authentication/authentication.js b/src/components/authentication/authentication.js index 8122b537c..43b56a505 100644 --- a/src/components/authentication/authentication.js +++ b/src/components/authentication/authentication.js @@ -18,7 +18,7 @@ import { translate } from '../i18n/i18n'; * @param {object} props * @param {string} props.appName * @param {Function} props.authorizeUser - * @param {Node} props.children + * @param {React.ReactNode} props.children * @param {Function} props.hideGlobalFilter * @param {Function} props.initializeChrome * @param {boolean} props.isDisabled @@ -28,7 +28,7 @@ import { translate } from '../i18n/i18n'; * @param {Function} props.t * @param {Function} props.useDispatch * @param {Function} props.useHistory - * @returns {Node} + * @returns {React.ReactNode} */ const Authentication = ({ appName, @@ -72,7 +72,7 @@ const Authentication = ({ } if (isAuthorized) { - return {children}; + return children; } if (pending) { @@ -97,7 +97,7 @@ const Authentication = ({ * Prop types. * * @type {{authorizeUser: Function, onNavigation: Function, useHistory: Function, setAppName: Function, - * t: Function, children: Node, appName: string, initializeChrome: Function, session: object, + * t: Function, children: React.ReactNode, appName: string, initializeChrome: Function, session: object, * useDispatch: Function, isDisabled: boolean, hideGlobalFilter: Function}} */ Authentication.propTypes = { diff --git a/src/components/i18n/i18n.js b/src/components/i18n/i18n.js index 21fbc5a5c..d7267b4fb 100644 --- a/src/components/i18n/i18n.js +++ b/src/components/i18n/i18n.js @@ -13,7 +13,7 @@ import { helpers } from '../../common/helpers'; * @param {string|Array} translateKey A key reference, or an array of a primary key with fallback keys. * @param {string|object|Array} values A default string if the key can't be found. An object with i18next settings. Or an array of objects (key/value) pairs used to replace string tokes. i.e. "[{ hello: 'world' }]" * @param {Array} components An array of HTML/React nodes used to replace string tokens. i.e. "[, ]" - * @returns {string|Node} + * @returns {string|React.ReactNode} */ const translate = (translateKey, values = null, components) => { const updatedValues = values; @@ -47,8 +47,8 @@ const translate = (translateKey, values = null, components) => { /** * Apply string replacements against a component, HOC. * - * @param {Node} Component - * @returns {Node} + * @param {React.ReactNode} Component + * @returns {React.ReactNode} */ const translateComponent = Component => { const withTranslation = ({ ...props }) => ( @@ -67,11 +67,11 @@ const translateComponent = Component => { * Load I18n. * * @param {object} props - * @param {Node} props.children + * @param {React.ReactNode} props.children * @param {string} props.fallbackLng * @param {string} props.loadPath * @param {string} props.locale - * @returns {Node} + * @returns {React.ReactNode} */ const I18n = ({ children, fallbackLng, loadPath, locale }) => { const [initialized, setInitialized] = useState(false); @@ -117,13 +117,13 @@ const I18n = ({ children, fallbackLng, loadPath, locale }) => { } }, [initialized, locale]); - return (initialized && {children}) || ; + return (initialized && children) || ; }; /** * Prop types. * - * @type {{loadPath: string, children: Node, locale: string, fallbackLng: string}} + * @type {{loadPath: string, children: React.ReactNode, locale: string, fallbackLng: string}} */ I18n.propTypes = { children: PropTypes.node.isRequired, diff --git a/src/components/inventoryTabs/__tests__/__snapshots__/inventoryTab.test.js.snap b/src/components/inventoryTabs/__tests__/__snapshots__/inventoryTab.test.js.snap index e7306fa5e..8b4576cae 100644 --- a/src/components/inventoryTabs/__tests__/__snapshots__/inventoryTab.test.js.snap +++ b/src/components/inventoryTabs/__tests__/__snapshots__/inventoryTab.test.js.snap @@ -13,9 +13,7 @@ Array [ `; exports[`InventoryTab Component should output a non-connected component: non-connected 1`] = ` - -
- lorem ipsum -
-
+
+ lorem ipsum +
`; diff --git a/src/components/inventoryTabs/inventoryTab.js b/src/components/inventoryTabs/inventoryTab.js index 8b107006a..93427e29f 100644 --- a/src/components/inventoryTabs/inventoryTab.js +++ b/src/components/inventoryTabs/inventoryTab.js @@ -6,17 +6,17 @@ import PropTypes from 'prop-types'; * * @param {object} props * @param {boolean} props.active - * @param {Node} props.children + * @param {React.ReactNode} props.children * @param {string} props.title - * @returns {Node} + * @returns {React.ReactNode} */ // eslint-disable-next-line no-unused-vars -const InventoryTab = ({ active, children, title }) => {children}; +const InventoryTab = ({ active, children, title }) => children; /** * Prop types. * - * @type {{children: Node, className: string}} + * @type {{children: React.ReactNode, className: string}} */ InventoryTab.propTypes = { children: PropTypes.node.isRequired, diff --git a/src/config/__tests__/__snapshots__/product.rhosak.test.js.snap b/src/config/__tests__/__snapshots__/product.rhosak.test.js.snap index 031c87296..103a712c4 100644 --- a/src/config/__tests__/__snapshots__/product.rhosak.test.js.snap +++ b/src/config/__tests__/__snapshots__/product.rhosak.test.js.snap @@ -80,16 +80,14 @@ exports[`Product RHOSAK config should apply an instances inventory configuration Object { "cells": Array [ Object { - "title": - - , + "title": , }, Object { "title": "t(curiosity-inventory.measurement, {\\"context\\":\\"Transfer-gibibytes\\",\\"total\\":\\"0.00035\\"})", diff --git a/src/config/product.rhosak.js b/src/config/product.rhosak.js index 2a0947e1e..95d32960f 100644 --- a/src/config/product.rhosak.js +++ b/src/config/product.rhosak.js @@ -134,7 +134,7 @@ const config = { ); } - return {updatedDisplayName}; + return updatedDisplayName; }, isSortable: true },