From 071aaee55dd6a89dc26a00ec03e85cf58a7d8bbb Mon Sep 17 00:00:00 2001 From: Oleksandr Hladchenko1 Date: Wed, 27 Nov 2024 11:18:39 +0100 Subject: [PATCH] UIPFIMP-71: React v19: refactor away from default props for functional components --- CHANGELOG.md | 5 +++++ src/FindImportProfile/FindImportProfile.js | 26 ++++++++++------------ 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe29981..189410d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change history for ui-plugin-find-import-profile +## [8.1.0] In progress + +### Features added: +* `React v19`: refactor away from default props for functional components (UIPFIMP-71) + ## [8.0.0](https://github.com/folio-org/ui-plugin-find-import-profile/tree/v8.0.0) (2024-10-31) ### Features added: diff --git a/src/FindImportProfile/FindImportProfile.js b/src/FindImportProfile/FindImportProfile.js index f63de90..5927c4b 100644 --- a/src/FindImportProfile/FindImportProfile.js +++ b/src/FindImportProfile/FindImportProfile.js @@ -31,6 +31,14 @@ const profileContainers = { [ENTITY_KEYS.MAPPING_PROFILES]: containers.MappingProfilesContainer, }; +const defaultPluginProps = { + disabled: false, + marginBottom0: true, + marginTop0: true, + searchButtonStyle: 'primary', + searchLabel: , +}; + const FindImportProfile = ({ entityKey, parentType, @@ -38,10 +46,10 @@ const FindImportProfile = ({ profileType, profileName, onLink, - onClose, - isSingleSelect, - isMultiLink, filterParams, + onClose = noop, + isSingleSelect = false, + isMultiLink = true, ...rest }) => { const FindImportProfileContainer = profileContainers[entityKey]; @@ -180,6 +188,7 @@ const FindImportProfile = ({ return ( @@ -264,15 +273,4 @@ FindImportProfile.propTypes = { onClose: PropTypes.func, }; -FindImportProfile.defaultProps = { - disabled: false, - marginBottom0: true, - marginTop0: true, - searchButtonStyle: 'primary', - searchLabel: , - isSingleSelect: false, - isMultiLink: true, - onClose: noop, -}; - export default FindImportProfile;