fix: lint errors in widget-renderer.tsx and layout.tsx
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 50/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- next.js, react, typescript
Direzione di ricerca
Start by running pnpm lint and inspect apps/app/src/components/generative-ui/widget-renderer.tsx at the two reported effects and the unused description prop, then review layout.tsx at the Google Fonts link. Done means the Plus Jakarta Sans load uses next/font, the effect lint errors and unused prop warning are resolved, and pnpm lint passes without errors or warnings.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
The pnpm lint CI check is failing with 2 errors and 2 warnings.
Errors
1. react-hooks/set-state-in-effect in widget-renderer.tsx:414
// apps/app/src/components/generative-ui/widget-renderer.tsx
useEffect(() => {
if (!active) return;
setIndex(0); // ← setState called synchronously in effect
const interval = setInterval(() => {
setIndex((i) => (i + 1) % LOADING_PHRASES.length);
}, 1800);
return () => clearInterval(interval);
}, [active]);
Fix: Reset the index outside the effect (e.g. derive from active changing, or use a ref).
2. react-hooks/set-state-in-effect in widget-renderer.tsx:457
useEffect(() => {
if (!html || !iframeRef.current) return;
if (html === committedHtmlRef.current) return;
committedHtmlRef.current = html;
iframeRef.current.srcdoc = assembleDocument(html);
setLoaded(false); // ← setState called synchronously in effect
setHeight(0);
}, [html]);
Fix: Restructure so loaded/height are derived from html changes without synchronous setState in the effect body.
Warnings
3. Unused description prop — widget-renderer.tsx:424
export function WidgetRenderer({ title, description, html }: WidgetRendererProps) {
// ^^^^^^^^^^^ defined but never used
Fix: Either use the prop or prefix with underscore (_description).
4. Custom font loaded in layout.tsx instead of next/font — layout.tsx:15
<link
href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap"
rel="stylesheet"
/>
Fix: Use next/font/google to load Plus Jakarta Sans for automatic optimization and self-hosting.
- Lingua principale
- TypeScript
- Stelle
- 1.6k
- Fork
- 202
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di CopilotKit/OpenGenerativeUI
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
CopilotKit/OpenGenerativeUI#87 · 2 commenti ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
Tutte le issue di CopilotKit/OpenGenerativeUI
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
safetrustcr/dApp-SafeTrust#426 ·
-
area:workflow bug ready-for-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
fil-donadoni/tolaria#4409 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Fission-AI/OpenSpec#1960 ·
-
Add dependabot Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
corsairdev/corsair#1764 ·