@@ -12,6 +12,7 @@ import {
1212 * @param callback The function that will be called once before the component has not yet been rendered
1313 */
1414export function useOnBeforeComponentRendered ( callback : ( ) => void ) : void {
15+ // eslint-disable-next-line react-hooks/exhaustive-deps
1516 useMemo ( callback , [ ] ) ;
1617}
1718
@@ -25,17 +26,17 @@ export function useOnBeforeComponentRendered(callback: () => void): void {
2526 * else this function will be called during unmounting. If this behavior is needed, `useEffect` should be used instead.
2627 */
2728export function useOnComponentMounted ( callback : ( ) => void ) : void {
28- useEffect (
29- callback ,
30- [ ] ,
31- ) ;
29+ // eslint-disable-next-line react-hooks/exhaustive-deps
30+ useEffect ( callback , [ ] ) ;
3231}
3332
3433export function useOnComponentUnMounted ( callback : ( ) => void ) : void {
34+ // eslint-disable-next-line react-hooks/exhaustive-deps
3535 useEffect ( ( ) => callback , [ ] ) ;
3636}
3737
3838export function useOnDependenciesChange ( callback : ( ) => void , dependencies : DependencyList ) : void {
39+ // eslint-disable-next-line react-hooks/exhaustive-deps
3940 useEffect ( callback , dependencies ) ;
4041}
4142
@@ -53,9 +54,11 @@ export function useOnDependenciesChange(callback: () => void, dependencies: Depe
5354export function useEffectWithSsrSupport ( callback : ( ) => void , dependencies : DependencyList = [ ] ) : void {
5455 if ( typeof process !== 'undefined' ) {
5556 // server context
57+ // eslint-disable-next-line react-hooks/rules-of-hooks
5658 useMemo ( callback , dependencies ) ;
5759 } else {
5860 // browser context
61+ // eslint-disable-next-line react-hooks/rules-of-hooks
5962 useEffect ( callback , dependencies ) ;
6063 }
6164}
0 commit comments