Skip to content

Commit c483257

Browse files
committed
Address next build warnings
1 parent 4e3552d commit c483257

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/components/custom-mdx/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default function CustomMDX({ content }: CustomMDXProps) {
3030
// When we do a client-side navigation to another page
3131
// the content will change & we will need to do a reset.
3232
resetHeaderIdsInView();
33-
}, [content]);
33+
}, [content, resetHeaderIdsInView]);
3434

3535
return (
3636
<div className={s.customMDX}>

src/components/jumplink-header/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default function JumplinkHeader({
2929
const updateHeaderIdInView = useStore((state) => state.updateHeaderIdInView);
3030
useEffect(() => {
3131
updateHeaderIdInView(inView, id);
32-
}, [inView]);
32+
}, [inView, id, updateHeaderIdInView]);
3333

3434
return (
3535
<div className={s.jumplinkHeader} id={id}>

src/components/mermaid/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export default function Mermaid({ chart, id, className = "" }: MermaidProps) {
1414

1515
useEffect(() => {
1616
let mermaidInstance: any;
17+
const element = elementRef.current;
1718

1819
const renderMermaid = async () => {
1920
try {
@@ -78,8 +79,7 @@ export default function Mermaid({ chart, id, className = "" }: MermaidProps) {
7879

7980
mermaidInstance = mermaid;
8081

81-
if (elementRef.current) {
82-
const element = elementRef.current;
82+
if (element) {
8383
element.innerHTML = "";
8484

8585
const diagramId =
@@ -136,8 +136,8 @@ export default function Mermaid({ chart, id, className = "" }: MermaidProps) {
136136
renderMermaid();
137137

138138
return () => {
139-
if (elementRef.current) {
140-
elementRef.current.innerHTML = "";
139+
if (element) {
140+
element.innerHTML = "";
141141
}
142142
};
143143
}, [chart, id]);

0 commit comments

Comments
 (0)