我想使用Jest + Enzyme测试React Hooks中的useState和useEffect,但是我找不到方法,有人可以帮忙吗?
const [sPlaceholder, setSPlaceholder] = useState('');
useEffect(() => {
setSPlaceholder('abcd');
if (s === '') {
dispatchUpdateSPlaceholder(searchPlaceholder);
}
}, [sPlaceholder]);