13 lines
326 B
JavaScript
13 lines
326 B
JavaScript
'use client';
|
|
|
|
import * as React from 'react';
|
|
const EMPTY = [];
|
|
|
|
/**
|
|
* A React.useEffect equivalent that runs once, when the component is mounted.
|
|
*/
|
|
export default function useOnMount(fn) {
|
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
React.useEffect(fn, EMPTY);
|
|
/* eslint-enable react-hooks/exhaustive-deps */
|
|
} |