Skip to content

Commit

Permalink
removed last useLayoutEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
joepuzzo committed Jan 9, 2023
1 parent 77e7586 commit f758ee4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 4.38.2 (January 9th, 2023)

### Fixed

- Issue where old ( no longer used ) useLayoutEffect would throw errors in next js apps ( SSR apps )

## 4.38.1 (January 9th, 2023)

### Fixed
Expand Down
21 changes: 1 addition & 20 deletions src/hooks/useField.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import React, {
useState,
useRef,
useLayoutEffect,
useEffect,
useContext,
useMemo
} from 'react';
import React, { useState, useRef, useEffect, useContext, useMemo } from 'react';
import { useFieldApi } from './useFieldApi';
import { useRelevance } from './useRelevance';
import { useFieldState } from './useFieldState';
Expand Down Expand Up @@ -52,7 +45,6 @@ export const useField = ({
keep,
keepState: userKeepState,
keepStateIfRelevant: userKeepStateIfRelevant,
debug,
inputRef,
inputRefs,
relevant,
Expand Down Expand Up @@ -353,17 +345,6 @@ export const useField = ({
}
});

useLayoutEffect(() => {
if (debug && ref && ref.current) {
ref.current.style.background = 'orange';
setTimeout(() => {
if (ref.current) {
ref.current.style.background = 'grey';
}
}, 300);
}
});

const render = children => (isRelevant ? children : null);

const changeHandler = generateOnChange({
Expand Down

0 comments on commit f758ee4

Please sign in to comment.