const [radioValue, setRadioValue] = React.useState("some_value");
const radioChange = (event, { value }) => {
setRadioValue(value);
};
这就是我的尝试
describe("radioChange", () => {
it("radioChange on radio button", () => {
const { result } = renderHook(useAppendValuesState);
act(() => {
result.current.radioChange();
});
console.log(result);
expect(result.current.radioValue).toBe("test");
});
});
获取TypeError:无法读取未定义的属性“值”,请帮忙!