From ee5afda880a32f10c15749a986616c2256b8db25 Mon Sep 17 00:00:00 2001 From: melloware Date: Thu, 16 Nov 2023 06:44:54 -0500 Subject: [PATCH] Fix #5328: Showcase fixes --- components/news/newssection.js | 7 ++++--- pages/landing/herosection.js | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/components/news/newssection.js b/components/news/newssection.js index d8c78ce184..c3bd508a76 100644 --- a/components/news/newssection.js +++ b/components/news/newssection.js @@ -1,11 +1,12 @@ -import React, { useEffect, useRef } from 'react'; +import React, { useRef } from 'react'; import AnnouncementData from '../../data/news.json'; +import { useMountEffect } from '../lib/hooks/Hooks'; export default function NewsSection(props) { const storageKey = 'primereact-news'; const announcement = useRef(AnnouncementData); - useEffect(() => { + useMountEffect(() => { const itemString = localStorage.getItem(storageKey); if (itemString) { @@ -17,7 +18,7 @@ export default function NewsSection(props) { } else { props.setNewsActive(true); } - }, []); + }); const onNewsClose = () => { props.setNewsActive(false); diff --git a/pages/landing/herosection.js b/pages/landing/herosection.js index 2901856cbe..ef9fb7bb1c 100644 --- a/pages/landing/herosection.js +++ b/pages/landing/herosection.js @@ -11,7 +11,7 @@ import { InputSwitch } from '../../components/lib/inputswitch/InputSwitch'; import { RadioButton } from '../../components/lib/radiobutton/RadioButton'; import { SelectButton } from '../../components/lib/selectbutton/SelectButton'; import { Slider } from '../../components/lib/slider/Slider'; -import { TabMenu } from '../../components/lib/tabmenu/Tabmenu'; +import { TabMenu } from '../../components/lib/tabmenu/TabMenu'; const HeroSection = (props) => { const selectButtonOptions = [