Skip to content

Commit

Permalink
chore: react-scan for dev
Browse files Browse the repository at this point in the history
  • Loading branch information
asmyshlyaev177 committed Nov 21, 2024
1 parent 2a3f4f7 commit 9ad5dd9
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 20 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ module.exports = {
usePrettierrc: false,
plugins: ["eslint-plugin-prettier-plugin-tailwindcss"]
},
]
],
'react/display-name': 'off'
},
overrides: [
{
Expand Down
5 changes: 4 additions & 1 deletion packages/example-nextjs14/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": ["next/core-web-vitals"],
"root": true
"root": true,
"rules": {
"react/display-name": "off"
}
}
4 changes: 2 additions & 2 deletions packages/example-nextjs14/src/app/Status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -49,4 +49,4 @@ export const Status = ({
/>
</div>
);
};
})
1 change: 1 addition & 0 deletions packages/example-nextjs14/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default async function RootLayout({
<html lang="en">
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="" />
{!isProd && <script src="https://unpkg.com/react-scan/dist/auto.global.js" async /> }

{isVercel && <link rel="canonical" href={vercelUrl}></link>}
<meta name="google-site-verification" content="NKunqTB4Sd_Bp6zoIbzKvw_WoGB-v2-MXxC5mbKJKJw" />
Expand Down
35 changes: 19 additions & 16 deletions packages/shared/components/Refresh.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import { clsx } from "clsx";
import React from "react";

import { Button } from "./Button";
export const RefreshButton = ({ className }: { className?: string }) => {
return (
<Button
onClick={() => {
window.location.reload();
}}
className={clsx(
`transition font-extrabold bg-orange-700 text-lg text-white`,
className,
)}
name="Reload page"
>
Reload page
</Button>
);
};
export const RefreshButton = React.memo(
({ className }: { className?: string }) => {
return (
<Button
onClick={() => {
window.location.reload();
}}
className={clsx(
`transition font-extrabold bg-orange-700 text-lg text-white`,
className,
)}
name="Reload page"
>
Reload page
</Button>
);
},
);

0 comments on commit 9ad5dd9

Please sign in to comment.