小编mxc*_*cdh的帖子

类型 'Merge<FieldError, FieldErrorsImpl<DeepRequired<any>>> | undefined' 不可分配给类型 'string | 不明确的'

我的输入中存在变量错误问题。我添加到接口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)

reactjs

23
推荐指数
2
解决办法
2万
查看次数

如何使用 React 17 安装 next-js?

如何使用 React 17 安装 next.js?当我输入:npx create-next-app --ts时,npx使用React 18安装了Next,但我无法使用React 18,因为Stripe目前无法与R18一起工作(https://www.npmjs.com/包/条)。

stripe-payments reactjs next.js

11
推荐指数
2
解决办法
1万
查看次数

没有时间/只有数据的日期时间?在 Prisma 中可能吗?

我可以在 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)

postgresql prisma

10
推荐指数
1
解决办法
2万
查看次数

如何直接在当前文件夹中创建 next.js 应用程序

如何在当前文件夹中创建下一个应用程序?

我试过:

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)

typescript reactjs next.js

8
推荐指数
1
解决办法
1万
查看次数

导入和类型:模块的 prisma db 种子和打字稿问题

我从本教程学习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)

next.js prisma

5
推荐指数
2
解决办法
1万
查看次数

nextjs + auth / 该网站无法提供安全连接

我的项目中存在安全连接问题。下面是我的设置和代码: 在此输入图像描述 在此输入图像描述

怎么了?

ps 我基于本教程的代码: https://thetechhulk.com/auth0-and-next-js-authentication-complete-guide

auth0 next.js

3
推荐指数
2
解决办法
3803
查看次数

溢出和分解文本的问题

我使用顺风溢出,用于右侧的水平滚动。我的代码的以下示例:

  <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 如何隐藏顺风滚动?

tailwind-css

2
推荐指数
1
解决办法
2097
查看次数