Skip to content

Commit 97e5fba

Browse files
navinkarkerabradenmacdonald
authored andcommitted
chore: add comment to prevent course search reload on type
1 parent 03a757d commit 97e5fba

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/course-outline/subsection-card/SubsectionCard.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ const SubsectionCard = ({
5757
const [isFormOpen, openForm, closeForm] = useToggle(false);
5858
const namePrefix = 'subsection';
5959
const { sharedClipboardData, showPasteUnit } = useClipboard();
60+
// WARNING: Do not use "useStudioHome" to get "librariesV2Enabled" flag below,
61+
// as it has a useEffect that fetches course waffle flags whenever
62+
// location.search is updated. Course search updates location.search when
63+
// user types, which will then trigger the useEffect and reload the page.
64+
// See https://github.com/openedx/frontend-app-authoring/pull/1938.
6065
const { librariesV2Enabled } = useSelector(getStudioHomeData);
6166
const [
6267
isAddLibraryUnitModalOpen,

0 commit comments

Comments
 (0)