All Questions
Tagged with react-component or reactjs
40 questions from the last 7 days
Advice
1 vote
4 replies
79 views
Should I use transformer functions for the data I get from API?
I have a project in Next JS and I am fetching data from API using TanStack Query. I am also using openapi-typescript package for generating API response types automatically from the openapi.json file. ...
-5 votes
2 answers
84 views
TypeScript error "Argument of type 'string' is not assignable to parameter of type 'never'" when filtering array in React
I'm building a data filtering component in React/TypeScript, and I'm getting a confusing TypeScript error when trying to filter an array based on user input. The error says my string argument is type ...
-3 votes
1 answer
79 views
The proper way to assign a default value to a React component prop
I'm looking for a working & elegant solution to assign a default prop value to a React Native core component such as Text. In the past, we'd do something like this and override it at the index.js ...
1 vote
2 answers
94 views
How to prevent rerender of identical component in child?
I'm trying to make a progress bar that has a transition animation. Think: a multi-page wizard, and when you advance to the next page the progress bar animates to the next step. When the progress bar ...
Best practices
1 vote
5 replies
102 views
Where to manage the state of individual items in a list
So, being used other reactive frameworks I'm now starting to learn and work with React. I'm building a simple exercise and I'm struggling with the way State is managed in React, I'll already have ...
0 votes
1 answer
83 views
In Reactjs when i share the link from android to ios on telegram the url open but not able to see anything [closed]
I’m working on a referral feature in my React (Vite) app where users can share a link using the Web Share API. The sharing part works fine on all devices, and the link itself is correct. The issue ...
-4 votes
0 answers
76 views
Why do React tasks disappear when navigating or moving items between lists?
Context I am building a To-Do application using React.js and Tailwind. The app has a navigation bar with three distinct sections/routes: My Todo (The main list) Scheduled Tasks Completed Tasks The ...
-1 votes
2 answers
58 views
How to display <NavLink> components outside MemoryRouter in React Router? [duplicate]
How to display <NavLink> components inside the Footer? I cannot place the Footer inside RouterProvider. The Footer component should be displayed on every page. function App() { const router = ...
2 votes
1 answer
74 views
React 18 streaming chat messages updating with stale state
i’m building a small AI chat ui in react (next.js app router, react 18) that streams tokens from my backend (openai style stream). basic flow: user types a prompt i push the user message into ...
Best practices
0 votes
1 replies
56 views
What’s the best architecture for mixing local AI + cloud AI inside a React/JS app without turning the codebase into spaghetti?
I’m trying to design a “future-proof” React/JS setup where the app can switch between different AI backends (local models like WebGPU/WebLLM, API models like OpenAI/Gemini, and maybe even custom ...
-3 votes
0 answers
67 views
React: AudioContext sound plays inconsistently on mouse wheel rotation [closed]
I’m implementing a Pomodoro timer where rotating a wheel (like a physical knob) should play a short mechanical “click” sound on every mouse-wheel step. I tried two approaches: Using AudioContext ...
-4 votes
0 answers
71 views
Catch error thrown from child route in tanstack
I want to control conditions related to that route in each route instead of building central navigation system in the root route that checks from and to of the navigation event. To that, my idea was ...
-4 votes
1 answer
49 views
Infinite offset scroll handling on adding/updating elements [closed]
I am working on a personal project that is a tracker of different expenses, subscriptions, loans and etc (all of them are separate entities). Each user has his/her/their personal account and can see ...
-1 votes
0 answers
57 views
Getting spacing and alignment in JSON Forms correctly [closed]
I'm trying to use JSON Forms to create different forms for my website, and I'm using custom buttons and input fields (using custom renderers) to render the form. I'm interested in making the UI right, ...
0 votes
0 answers
55 views
When client opens it from browser history it opens JSON return not a component [closed]
I have problem with all Inertia projects. When the user opens the page from their browser history it opens a JSON not a React page. How can I prevent this? I have: "dependencies": { &...