I am implementing a provider which helps me to have the state of my user in different views, the main function of this provider is to render different one or the other stack navigator depending on whether the variable is full or empty, this in order to be able to generate two groups of screens depending on whether the user
Tag: reactjs
Pulling and displaying API data to tailwind cards
could someone help on how to get all data from this console log? I am trying to display all the details in individual tailwind cards but not sure how to get the data. Thank you for your time. It works and I get the results below in console. when I tried console.log (response.data.0.pdf) for example, it gives an error “Parsing
unable to use MaterialUI Datepicker,Dayjs with useFormik and Yup
I am using Material UI Date picker with day js,but the issue that arising again and again is,’when I select the date on calender,1st time it updates in textfield and then it is not working.And also having problem in Yup like when touched 1st time it gives error means works perfectly but when removing the date from text field and
React setState of an object with count
I have an array of integers from 0 to 6 as input I need to return an object with the count of each of those numbers but I can’t do the function for the set of values I am expecting this Can you help me? Thank you very much Answer You can use reduce()
npx create-next-app asks me if I want to use TypeScript, but won’t take no for an answer
I’m getting the following when I try to do an npx create-next-app: I’m trying to work through some training that doesn’t use TypeScript, but it won’t let me select No for an answer. I don’t understand why it asks the question. Another PC of mine doesn’t ask me about TypeScript, so it must be a configuration issue. Answer create-next-app behaves
Is it valid to use the “return” keyword in a useEffect to stop code execution?
I was debating with a collegue today about using the “return” key in a useEffect to stop code execution. I have learned that using return should only be done in a cleanup. The issue: The way I see this is that we should perhaps have yet another useEffect that only execute if the state is false and not use the
No component being rendered on router.push(‘/page’) unless reloaded
On successful login, I’m embedding the user token in browser cookies and using router.push(‘/dashboard’) to take the user to his dashboard, but the ‘/dashboard’ page is not rendering any components unless I trigger a reload, on which all the components are rendered on the screen. Code block from /login page: Code block from /dashboard page: which on first returns a
ReferenceError: FileReader is not defined in Next.js
I am trying out the new functions of Next.js 13 with the /app folder, but in a simple client-side component that handles an input form, I am trying to use FileReader but receive an error when browsing. This is the summary of the code: Error: What am I doing wrong? Answer Like accessing window, any browser-specific code in Next.js needs
Updating state using api in useLayoutEffect does not work before painting component
The getUser method exists for API calls. I am trying to display the user profile when the user refreshes the website. That’s why I used useLayoutEffect because I wanted to update the globalUser state before painting and then show it when the web page is painted. But the globalUser state value is null when I refresh the page, then quickly
React rerender component on database change
Im trying to develop a dynamic todoList. I have two components TodoList, and Todo. TodoList fetches with useSWR the data from Mongo and puts the data in a div depending if they’re completed or not. Todo component has a button to mark if the task its completed or not. When you click the input check it changes automatically on mongo.