Back to feed
Dev.to
Dev.to
6/22/2026
I got tired of rewriting the same AI boilerplate so I built a library to fix it

I got tired of rewriting the same AI boilerplate so I built a library to fix it

Short summary

Strand eliminates 200+ lines of repetitive boilerplate when integrating AI into React apps. The useConversation hook handles streaming, message history, tool orchestration, cancellation, and retry logic, while useToolCall provides observable tool state (pending → running → done) accessible from any component without prop drilling. MIT licensed, supports Anthropic, OpenAI, and Google Gemini with swappable providers.

  • useConversation hook handles streaming, message history, tool orchestration, cancellation, and retry in one place
  • useToolCall provides observable tool state (pending → running → done) from any component without prop drilling
  • MIT licensed; works with Anthropic, OpenAI, and Google Gemini; swap providers with one import change

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Explore more