Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

fix: lint errors in widget-renderer.tsx and layout.tsx

Aberta
#2 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

  • #13 de @Jah-yee — fechado sem integrar

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
50/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Estagnada
Stack de tecnologia
next.js, react, typescript
Domínio
frontend, tooling

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

bug

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.

Linguagem predominante
TypeScript
Estrelas
3.9k
Forks
414
Merge médio
4h
PRs com merge (30d)
6

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de CopilotKit/OpenIntelligentUI

Todas as issues de CopilotKit/OpenIntelligentUI

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.