首页 > 解决方案 > 如何解决消息 304 未修改

问题描述

304 未修改

我在 material-ui 中使用 Autocompleted

 <Autocomplete
        id="cbCity"
        inputValue={city}
        onChange={(e,v) => setCity(v)}
        options={cityDropdown}
        getOptionLabel={(option) => option }
        value={city}
        renderInput={(params) => (
          <TextField
            variant="outlined"
            margin="normal"
            {...params}
            name="city"
            label="City"
            id="city"
            required
            fullWidth
            defaultValue={city}
            onChange={({ target }) => setCity(target.value)}
          />

当我单击清除按钮时,它会重定向到一个白页。查看我的 Inspect Element 的 Network 部分,我在回复中得到 304 Not Modified。

我该如何解决这个问题? 清除按钮

标签: reactjsautocompletehttp-status-code-304

解决方案


推荐阅读