Im doing a project in react native I have an object of exercises that include images and videos, everything is fine when the object was created, but when I imported into another file I get this error undefined Unable to resolve module https://assets.soysuper.fit/cutted+mvp+mp4s/bodyweight_squats.mp4 from /mnt/c/Users/USER/Documents/superfit/app/src/screens/Patient/Workouts/ExercisesList.ts: https://assets.soysuper.fit/cutted+mvp+mp4s/bodyweight_squats.mp4 could not be found within the project or in these directories: node_modules This is
Tag: reactjs
Conditional Component Rendering using UseState
I have a form in a page, when the user inputs the name of a new student and clicks submit, I want the content of that component (the form) to be completely replaced by the submitted name. How can I achieve this (Replace the form with the list onsubmit)? I have read that I can use conditional rendering to toggle
Paging in react
good morning, how are you? I’m having a problem with pagination, when I click to change the page it appears the page results and goes back to the first one right away, would you know how to help me? For example, if I click on page 2, its results appear but it immediately goes back to page 1, I don’t
React: Table custom sort doesn’t sort when data is mixed with capital and small letters
I am trying to sort data using custom sort function in react. Unfortunately the function only sort items if the records are either capital letter or small letter. It doesn’t sort the data with mixed capital and small letter properly. Here is the live link Here is the code I have tried to change a and b to lowercase from
Get Min date and Max date from Object
How can I find out the min and the max date from an object? Currently, I am getting an array like this: min date should be ‘2010-02-24’ and max date should be ‘2022-10-04’. Is there any built-in function to do this? Thanks in advance. Answer A sort will do the job here, by packing all dates into an array first:
Can I get away with not using useEffect in this instance?
I’m still learning React and the proper way to do things. In this React project I am using the TinyMCE editor: https://www.tiny.cloud/docs/tinymce/6/react-cloud/ I want to display a warning message about unsaved changes once the editor has been made “dirty” that is that the user has modified the default content you get on reload. The component that contains the editor has
React: multiple sliders sharing a common state
I have two sliders, each with an event listener. Using your mouse to adjust one slider should update a shared state, which should then cause a change in the second slider. However, I only want the event listener for the first slider to fire. In the code I have below, the second slider’s event listener is also firing, as can
Building Grid with random alphabetic characters
I’m working on a project where I need to build a 5*5 grid that is populated by random alphabetic characters(there can be more of the same letter). I’ve built this function, but the problem is that it’s always the same letter showing when rendering and in the log the letter is never repeated. Answer Represent the whole 2D array in
How to implement multiple functions on a single event handler?
I have this simple react native app that on button click it redirects user to a page. I’m saving data in a cache so that if user clicks the store button it stores data and after refresh it sets store data. However, I would like to implement this logic on a single button, not on 2 different buttons as it
React’s useRef hook doesn’t take a function?
I’m used to passing functions to useState, so that i don’t create unnecessary objects: I expected that useRef would work the same way, but the below returns a function instead of calling it once to intialize, then returning the prev created object after that. I suppose one could do something like this, but seems a lot less clean. Am I