我的输入中存在变量错误问题。我添加到接口error?: string,为什么 typeScript 向我显示这是通信?
Type 'Merge<FieldError, FieldErrorsImpl<DeepRequired<any>>> | undefined' is not assignable to type 'string | undefined'.
Type 'Merge<FieldError, FieldErrorsImpl<DeepRequired<any>>>' is not assignable to type 'string'.ts(2322)
Input.tsx(6, 3): The expected type comes from property 'error' which is declared here on type 'IntrinsicAttributes & InputProps'
Run Code Online (Sandbox Code Playgroud)
波纹管代码:
用法.tsx
import { yupResolver } from "@hookform/resolvers/yup";
import { useForm } from "react-hook-form";
import * as yup from "yup";
import Form from "./Form";
import Input from "./Input";
// interface for form
interface EmailInterface …Run Code Online (Sandbox Code Playgroud) 如何使用 React 17 安装 next.js?当我输入:npx create-next-app --ts时,npx使用React 18安装了Next,但我无法使用React 18,因为Stripe目前无法与R18一起工作(https://www.npmjs.com/包/条)。
我可以在 Prisma 中创建没有数据、没有时间的列吗?
我现在的模型:
model modelName {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
lastNumber Int
}
Run Code Online (Sandbox Code Playgroud)
实际结果:
2 2022-04-19 12:28:04.591+00 45
Run Code Online (Sandbox Code Playgroud)
我想生成这样的记录:
2 2022-04-19 45
Run Code Online (Sandbox Code Playgroud) 如何在当前文件夹中创建下一个应用程序?
我试过:
npx create-next-app@latest . --ts --use-npm
Run Code Online (Sandbox Code Playgroud)
但我收到错误:
Could not create a project called "folderName" because of npm naming restrictions:
* name can no longer contain capital letters
Run Code Online (Sandbox Code Playgroud) 我从本教程学习prisma: https://www.prisma.io/blog/fullstack-nextjs-graphql-prisma-oklidw1rhw
我的步骤有问题:
npx prisma db seed --preview-feature
我从本教程复制 1;1 代码,当我运行时:
npx prisma db seed --preview-feature
我收到错误:
prisma:warn Prisma "db seed" was in Preview and is now Generally Available.
You can now remove the --preview-feature flag.
prisma:warn The "ts-node" script in the package.json is not used anymore since version 3.0 and can now be removed.
Environment variables loaded from .env
Running seed command `ts-node prisma/seed.ts` ...
(node:34420) Warning: To load an ES module, set "type": "module" in the package.json or …Run Code Online (Sandbox Code Playgroud) 怎么了?
ps 我基于本教程的代码: https://thetechhulk.com/auth0-and-next-js-authentication-complete-guide
我使用顺风溢出,用于右侧的水平滚动。我的代码的以下示例:
<div className="bg-red-300">
<div className="bg-red-400">
<div className="container mx-auto pl-3 pr-3 pt-6 pb-6 flex space-x-2 overflow-x-auto">
<div className="flex space-x-2">
<div>Explore:</div>
<div className="font-bold underline">Shoes</div>
<div className="font-bold underline">Clothing</div>
<div className="font-bold underline">Accessories</div>
<div className="font-bold underline">Premium</div>
<div className="font-bold underline">Sport</div>
<div className="font-bold underline">Shop All</div>
</div>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
#1 为什么当屏幕是移动时,“Shop All”这个词就被破坏了?怎么修好呢?
#2 如何隐藏顺风滚动?