fix: lint errors in widget-renderer.tsx and layout.tsx
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 50/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- next.js, react, typescript
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- TypeScript
- Stars
- 1.6k
- Forks
- 202
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from CopilotKit/OpenGenerativeUI
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
CopilotKit/OpenGenerativeUI#87 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
All issues in CopilotKit/OpenGenerativeUI
Similar issues
-
clawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
ZCode 3.14.3 に対応する Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
supermomonga/zcode-acp#24 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
growthbook/growthbook#7100 ·
-
triage
Difficulty 1/5 1-3 hours Newbie friendliness 88/100