Skip to content

Commit

Permalink
Fix primefaces#5328: Showcase fixes (primefaces#5331)
Browse files Browse the repository at this point in the history
  • Loading branch information
kl-nevermore committed Nov 17, 2023
1 parent 923e482 commit fb3ea2b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/news/newssection.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand All @@ -17,8 +18,7 @@ export default function NewsSection(props) {
} else {
props.setNewsActive(true);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
});

const onNewsClose = () => {
props.setNewsActive(false);
Expand Down

0 comments on commit fb3ea2b

Please sign in to comment.