@@ -16,6 +16,9 @@ const CaseListWidget = ({ word }: IWidget) => {
const [caseData, setCaseData] = useState<ICaseListData[]>();
const [count, setCount] = useState<number>();
useEffect(() => {
+ if (typeof word === "undefined") {
+ return;
+ }
get<ICaseListResponse>(`/v2/case/${word}`).then((json) => {
console.log("case", json);
if (json.ok) {
@@ -55,6 +55,9 @@ const CompoundWidget = ({ word, add, split, onSearch }: IWidget) => {
}
}, [add, compound]);
get<IApiResponseDictList>(`/v2/userdict?view=compound&word=${word}`).then(
(json) => {