Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Component fixture state can be provided before the fixture mounts (eg.
// a previous snapshot of a fixture state or the current fixture state
// from another renderer)
if (!findFixtureStateProps(fixtureState, elementId)) {
const componentName = getComponentName(childEl.type);
setFixtureState(prevFs => ({
...prevFs,
props: createFixtureStateProps({
fixtureState: prevFs,
elementId,
values: createValues(childEl.props),
componentName
})
}));
} else if (
!areNodesEqual(
childEl,
getElementAtPath(prevFixtureRef.current, elPath)
)
) {
setFixtureState(prevFs => ({
...prevFs,
props: updateFixtureStateProps({
fixtureState,
elementId,
values: createValues(childEl.props)
})
}));
}
});
}, [
function fixtureChanged(f1: React.ReactNode, f2: React.ReactNode) {
return !areNodesEqual(f1, f2, true);
}
function fixtureChanged(f1: React.ReactNode, f2: React.ReactNode) {
return !areNodesEqual(f1, f2);
}