From 5c28071fb33931bbbe9bafe6792f222a372e1129 Mon Sep 17 00:00:00 2001 From: M-ZubairAhmed Date: Tue, 9 May 2023 16:28:44 +0530 Subject: [PATCH] [MM-MM-52695] webapp/channels : Change plain import of PropsFromRedux to "import type" for certain files (#23337) A while ago, we introduced the PropsFromRedux pattern, which was mostly used in class-based components or functional components if hooks were not used for selectors and dispatch. However, we discussed that it is recommended to import the type PropsFromRedux back to the component file from its index file with the type to avoid any cyclic import bugs. `import type {PropsFromRedux} from './index'; ` --- .../post_edit_history/edited_post_item/edited_post_item.tsx | 2 +- .../src/components/post_edit_history/post_edit_history.tsx | 2 +- .../post_reminder_custom_time_picker_modal.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/webapp/channels/src/components/post_edit_history/edited_post_item/edited_post_item.tsx b/webapp/channels/src/components/post_edit_history/edited_post_item/edited_post_item.tsx index a15cdc065f..99f2fded63 100644 --- a/webapp/channels/src/components/post_edit_history/edited_post_item/edited_post_item.tsx +++ b/webapp/channels/src/components/post_edit_history/edited_post_item/edited_post_item.tsx @@ -29,7 +29,7 @@ import InfoToast from 'components/info_toast/info_toast'; import RestorePostModal from '../restore_post_modal'; -import {PropsFromRedux} from '.'; +import type {PropsFromRedux} from './index'; const DATE_RANGES = [ RelativeRanges.TODAY_TITLE_CASE, diff --git a/webapp/channels/src/components/post_edit_history/post_edit_history.tsx b/webapp/channels/src/components/post_edit_history/post_edit_history.tsx index 653572ec70..8e24926b3f 100644 --- a/webapp/channels/src/components/post_edit_history/post_edit_history.tsx +++ b/webapp/channels/src/components/post_edit_history/post_edit_history.tsx @@ -11,7 +11,7 @@ import LoadingScreen from 'components/loading_screen'; import EditedPostItem from './edited_post_item'; -import {PropsFromRedux} from '.'; +import type {PropsFromRedux} from './index'; const renderView = (props: Record): JSX.Element => (