您正在將onChange處理程序傳遞給ChooseOption組件,但從未調用它。您可以在SearchItem組件中保持單選按鈕的狀態(因為您已經為它設置了一個狀態對象(selected)),或者您可以在ChooseOption內添加一個useEffect掛鉤,每當selected狀態在其中更新時調用onChange(或者在handleChange函數中更好: import { React, useState } from 'react';import styled from 'styled-components';import { FormControl, FormControlLabel, RadioGroup, Radio,} from '@material-ui/core';const ChooseOption = ({ onChange }) => { // define the passed onChange handler const [selected, setSelected] = useState('films'); const isButtonSelected = (value) => { if (selected === value) { return true; } }; const handleChange = (e) => { set