SVG Attribute | JSX Property |
---|---|
class |
className |
fill-opacity |
fillOpacity |
stroke-opacity |
strokeOpacity |
stroke-width |
strokeWidth |
stroke-linecap |
strokeLinecap |
stroke-linejoin |
strokeLinejoin |
stroke-dasharray |
strokeDasharray |
stroke-dashoffset |
strokeDashoffset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react'; | |
const useIsFirstRender = (): boolean => { | |
const isFirst = React.useRef(true); | |
if (isFirst.current) { | |
isFirst.current = false; | |
return true; | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { CI, PORT = 3000, VERCEL_ENV, NEXT_PUBLIC_VERCEL_ENV, VERCEL_URL, NEXT_PUBLIC_VERCEL_URL } = process.env; | |
export const ENVIRONMENT = VERCEL_ENV || NEXT_PUBLIC_VERCEL_ENV; | |
const baseDomainSource = CI ? VERCEL_URL : NEXT_PUBLIC_VERCEL_URL; | |
const baseDomain = baseDomainSource; | |
let BASE_URL: string; | |
if (ENVIRONMENT === 'preview') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use client"; | |
import { FastAverageColor } from "fast-average-color"; | |
import { useEffect, useState } from "react"; | |
const fac = new FastAverageColor(); | |
export function ImageWithAvgColor({ src }: { src: string }) { | |
const [avgColor, setAvgColor] = useState<string>("transparent"); | |
useEffect(() => { |
OlderNewer