随笔分类 - React
1
摘要:根据插件的功能和用途,可以将这些 VSCode 插件分为以下几类,并进行排序: 1. 代码编辑与格式化 Prettier - Code formatter 自动格式化代码,支持多种语言。 Prettier ESLint 集成 Prettier 和 ESLint,统一代码风格。 ESLint 提供 J
阅读全文
摘要:使用 map + key useMemo,useCallbak 组件 Fragement 异步组件 lazy 路由懒加载 PureComponent,meno 拓展 时间分片,延迟加载 SSR
阅读全文
摘要:原文:https://dev.to/martinadamsdev/20-github-repositories-to-become-a-react-master-opl#how-to-become-a-react-master-1 推荐的 GitHub 仓库列表: reactjs/reactjs.o
阅读全文
摘要:# Next.js 14 // src/app/api/product/route.ts import prisma from '@/prisma/prisma' import type { NextApiRequest, NextApiResponse } from 'next' // GET /
阅读全文
摘要:我们需要更新 UserProfile.tsx 组件,改用 Next.js 的 Link 组件而不是 react-router-dom 的 Link 组件。以下是解决方法: 这样可以确保组件更好地适应 Next.js 的框架,避免不兼容的问题。 # 错误的代码 'use client' import
阅读全文
摘要:Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error Error: Attempted to call generateViewport() from the
阅读全文
摘要:开发 Next.js 项目遇到报错: [cause]: TypeError: e_.createContext is not a function 出现这个报错的原因是在 Next.js 项目中,在 Server Component 中使用了MUI组件,但是MUI组件没有做 SSR 适配就会导致这个
阅读全文
摘要:Cursor 是一个强大的 AI 代码编辑器,提供了多种功能来提升您的编程效率。本文将详细介绍如何使用 Cursor 及其主要功能,帮助您更好地利用这个工具。 1. 自动完成功能 Cursor 包含强大的自动完成功能,通过 Tab 键补全代码,可预测您的下一次编辑。启用后,它始终处于打开状态,并会考
阅读全文
摘要:{ // 使用双引号包裹属性名 "quoteProps": "consistent", // 对象的键值对之间使用一致的空格 "bracketSpacing": true, // 行尾使用分号 "semi": true, // 行尾使用单引号而不是双引号 "singleQuote": true, /
阅读全文
摘要:print 'hello world!'module.exports = { // 扩展配置,包含Next.js的核心Web Vitals插件和TypeScript支持插件等 extends: ['next/core-web-vitals', 'plugin:@typescript-eslint/r
阅读全文
摘要:How to install Downloadthe nvm-setup.zip from the following URL https://github.com/coreybutler/nvm-windows/releases Expand and run nvm-setup.exe Use n
阅读全文
摘要:要将Nest.JS应用搭建在Apache服务器上,你需要了解Nest.JS是一个基于Node.js的框架,因此它本质上是一个后端服务,而Apache通常用作前端服务器或反向代理。以下是将Nest.JS应用与Apache服务器结合使用的步骤: 一、准备环境 安装Node.js: 确保在服务器上安装了N
阅读全文
摘要:在NestJS中,你可以使用@nestjs/swagger包来定义你的API文档,并且可以很容易地将这些文档转换为API调用。以下是一个简单的例子,展示如何使用NestJS和Swagger来创建一个API文档,并且如何生成API调用。 首先,安装@nestjs/swagger和swagger-ui-
阅读全文
摘要:对比这两个 tsconfig.json 文件,我们可以看到一些关键的差异。让我们逐项分析一下这些差异,并指出可能存在的问题。 修改前的 tsconfig.json { "compilerOptions": { "lib": ["dom", "dom.iterable", "esnext"], "al
阅读全文
摘要:Use 'tree' command to output classes's list. tree /f /a ["directory path"] > tree.txt Generate a module, controller, and service for books: nest gener
阅读全文
摘要:node_modules\cli-table3\src\utils.js:12 This is still related to the Node.js v22 compatibility issues, but now specifically with @nestjs/cli. Let's tr
阅读全文
摘要:Step 1: Installing Next.js npm install -g yarn mkdir -pv /var/www/project_folder_name cd /var/www/project_folder_name yarn create next-app Edit packag
阅读全文
摘要:1.Create a file named .vscode/launch.json { "version": "0.2.0", "configurations": [ { "name": "Next.js: debug server-side", "type": "node-terminal", "
阅读全文
摘要:Terminal yarn add -D eslint-config-prettier eslint-config-next @typescript-eslint/parser @typescript-eslint/eslint-plugin ..eslintrc.json "extends": [
阅读全文
摘要:修改 .eslintrc.json 文件 修改前 "extends": [ "eslint:recommended", "plugin:react/recommended", "plugin:@typescript-eslint/recommended", "plugin:@typescript-e
阅读全文
1