PromptsVault AI is thinking...
Searching the best prompts from our community
Searching the best prompts from our community
Prompts matching the #react tag
Build AI apps with Vercel AI SDK. Features: 1. useChat hook for chat UI. 2. useCompletion for text generation. 3. Streaming responses with React Server Components. 4. Edge functions for low latency. 5. Multiple provider support (OpenAI, Anthropic). 6. Route handlers for API. 7. Streaming JSON for structured data. 8. Automatic loading states. Use streamText and implement function calling.
Use Jotai's atomic approach to state. Concepts: 1. atom() for primitive state. 2. Derived atoms with get(). 3. Async atoms for data fetching. 4. atomFamily for dynamic atoms. 5. useAtom hook like useState. 6. Focus on specific atoms. 7. No string keys needed. 8. Works with Suspense. Minimal re-renders due to fine-grained subscriptions. Integrate with localStorage atoms for persistence.
Build a cross-platform desktop app with Electron and React. Architecture: 1. Main process for system APIs. 2. Renderer process with React UI. 3. IPC communication between processes. 4. Context isolation for security. 5. Auto-updater for releases. 6. Native menus and tray icons. 7. File system access and dialogs. 8. Custom window controls. Use electron-builder for packaging and implement deep linking for protocol handling.
Create stunning animations with Framer Motion. Techniques: 1. motion.div with animate prop. 2. Variants for orchestration. 3. Layout animations with layout prop. 4. Shared layout animations. 5. Exit animations with AnimatePresence. 6. Gesture animations (drag, tap, hover). 7. useScroll for scroll-triggered. 8. Custom spring physics. Use stagger for children and implement page transitions with ease.
I am starting a new web project. It will be a highly interactive single-page application (SPA) with real-time data updates. Compare and contrast React, Vue, and Angular for this project. Recommend one and justify your choice based on performance, learning curve, ecosystem, and scalability.
Explain the problem of state management in large frontend applications. What is "prop drilling"? How do libraries like Redux or Zustand solve this problem? Describe the basic concepts of a global store, actions, and reducers (or their equivalents).
Manage state simply with Zustand. Implementation: 1. create() store with actions. 2. Minimal boilerplate vs Redux. 3. No providers needed. 4. Middleware for persistence. 5. Devtools integration. 6. Slices pattern for large stores. 7. Immer for mutations. 8. TypeScript support. Use selectors to prevent unnecessary renders and implement computed values with get() in store.