From 9ad5dd993441e92bde0f2da596eb1e20e4f703ca Mon Sep 17 00:00:00 2001 From: asmyshlyaev177 Date: Thu, 21 Nov 2024 17:25:48 +0400 Subject: [PATCH 1/3] chore: react-scan for dev --- .eslintrc.cjs | 3 +- packages/example-nextjs14/.eslintrc.json | 5 ++- packages/example-nextjs14/src/app/Status.tsx | 4 +-- packages/example-nextjs14/src/app/layout.tsx | 1 + packages/shared/components/Refresh.tsx | 35 +++++++++++--------- 5 files changed, 28 insertions(+), 20 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 5f121ed6..77921e39 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -21,7 +21,8 @@ module.exports = { usePrettierrc: false, plugins: ["eslint-plugin-prettier-plugin-tailwindcss"] }, - ] + ], + 'react/display-name': 'off' }, overrides: [ { diff --git a/packages/example-nextjs14/.eslintrc.json b/packages/example-nextjs14/.eslintrc.json index 255fdc5c..2d7db814 100644 --- a/packages/example-nextjs14/.eslintrc.json +++ b/packages/example-nextjs14/.eslintrc.json @@ -1,4 +1,7 @@ { "extends": ["next/core-web-vitals"], - "root": true + "root": true, + "rules": { + "react/display-name": "off" + } } diff --git a/packages/example-nextjs14/src/app/Status.tsx b/packages/example-nextjs14/src/app/Status.tsx index 115c760b..98ab2e5e 100644 --- a/packages/example-nextjs14/src/app/Status.tsx +++ b/packages/example-nextjs14/src/app/Status.tsx @@ -5,7 +5,7 @@ import { useUrlState } from 'state-in-url/next'; import { SourceCodeBtn } from './components/SourceCodeBtn'; -export const Status = ({ +export const Status = React.memo(({ className, sp, ghLink @@ -49,4 +49,4 @@ export const Status = ({ /> ); -}; +}) diff --git a/packages/example-nextjs14/src/app/layout.tsx b/packages/example-nextjs14/src/app/layout.tsx index 8d562dcd..f2ea64cc 100644 --- a/packages/example-nextjs14/src/app/layout.tsx +++ b/packages/example-nextjs14/src/app/layout.tsx @@ -21,6 +21,7 @@ export default async function RootLayout({ + {!isProd &&