我正在尝试导航<Link href="/register">Register</Link>到我的注册页面,但是当我单击它时,我收到一条错误/警告,内容是:
或者
这是我的注册页面组件:
import type { NextPage } from "next/types";
import type { FormEvent } from "react";
import { useRef } from "react";
import { createUser } from "../../helpers/helperFuncs";
import styles from "./styles.module.scss";
const Register: NextPage = (): JSX.Element => {
const emailInputRef = useRef<HTMLInputElement | null>(null);
const passwordInputRef = useRef<HTMLInputElement | null>(null);
const submitHandler = async (event: FormEvent<HTMLFormElement>) => {
event.preventDefault();
const enteredEmail = emailInputRef.current?.value ?? "";
const enteredPassword = passwordInputRef.current?.value ?? …Run Code Online (Sandbox Code Playgroud)所以我有一个带有键及其对应值的元组列表.我想让它显示为字典,所以我写道
def tup_to_dict (lst):
return dict(lst)
Run Code Online (Sandbox Code Playgroud)
现在,如果我的是[("A3", "green"), ("B5", "blue"), ("A3", "yellow")],我的输出将是:
{'B5': 'blue', 'A3': 'yellow'}
Run Code Online (Sandbox Code Playgroud)
我如何检查一个密钥是否已经分配了一个值而不是覆盖它.所以我的输出看起来像这样:
{"A3": "green", "B5": "blue"}
Run Code Online (Sandbox Code Playgroud)
谢谢!