Skip to main content

15 posts tagged with "React.js"

React.js Library for Building User Interfaces

View All Tags

How to Render Markdown Safely in React with react-markdown

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

AI models and users write Markdown: numbered steps, bold words, tables, links. Shown as plain text, it's a mess of stars and pipes; turned into HTML and inserted with dangerouslySetInnerHTML, it can run whatever script someone slipped in. react-markdown turns Markdown into React elements instead. This guide renders a tricky piece of Markdown and shows what happens to the HTML and the script link inside it.

How to Keep Server-Only Code Out of the Browser in Next.js

· 8 min read
Jagdish Kumawat
Founder @ Dewiride

In a Next.js app, the same file can be imported by code that runs on the server and by code that runs in the browser. One import "server-only" line at the top of a module that handles secrets makes the build fail the moment a Client Component imports it. This guide shows the line, the error it produces, what ships to the browser without it, and the right way to give a Client Component what it needs.

Fixed: "signal is aborted without reason" After Stopping an AG-UI Run

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

My chat page had a Stop button that calls abortRun() on its AG-UI agent. Pressing it stopped the answer — and showed signal is aborted without reason in red, as if something had failed. That text is the browser's wording for a cancelled request: @ag-ui/client 1.0.5 ends a stopped run with its own RUN_ERROR event, code abort. Skipping that one code fixed it.