I try to filter the array with two conditions but without success, it only refers to the second condition, each condition individually works great. The original task : “When entering a text in the “search” text box, the users list will presents anly users that their name or email contains that text Answer
Tag: reactjs
I am passing a prop from App.js to MovieCard.js but props passed is showing empty
Complete github link -: https://github.com/dhruv354/movie-app.git My App.js In App.js i am using Map function to iterate over data file which is a array of objects and passing each object as a prop to Moviecard but it is showing empty My MovieCard.js In Moviecard i am receving movie object as a prop , i tried console logging but it is showing
implementing page javascript in next/react component
I am trying to implement a project like: https://codepen.io/andytran/pen/GpyKLM As you can see there is javascript that is needed for the page to function. I am trying to build a Next/React component that implements this code: Where would I put the javascript in the above example? Also, how would I call code from a scss file? Answer What you do
Changing the prop value of embedded component
I have made a tab-component and a progressbar with 3 tabs. When i select the first tab i want my progressbar to be at 33%, second tab 66% and third 100%. I need some help figuring out how to make my progress-bar change it’s value when i change tabs. The progress-meter fills up when you give a value of 0-100
How to make external javascript file work in ReactJs?
In a React project, my public.html file looks like this: All the components of the project load inside the “root” div. The “function.js” file is an external javascript file from a theme. In one of the React components, I have an input field: Now, inside “componentDidMount()” of that component, if I write it shows the “userName” field correctly in the
Fetch API not running with port number on localhost [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 1 year ago. Improve this question
filter antd table according to its columns
First of all english is not my mother language so there might be mistakes. I started react with hooks since everybody said its easier, here i have antd table and a button (bootstrap 5 modal), this modal contains 6 buttons (id, title, firstname, lastname, Choose all, confirm your selection), my point is user chooses from ID, Title, firstname, lastname, when
How to set time according to svg length?
I am learning javascript and react and here I am stuck in the challange that where I have to set time according to SVG image’s length (something like progress bar). For an ease and basic example, I am calculating total time of 24 hours in 1440 minutes and I have given passed time let passedMins = 1220 Now I need
Why does addEventListener and removeEventListener inside useEffect() require an arrow function?
I’m trying to set onTop state to true if the user has scrolled to the top and false otherwise. I tried the following. The above example doesn’t work but throws no error either. Note that I added an arrow and braces to the second parameter function. The above example works as intended. Can anyone explain why? Thanks very much! Answer
How to use useRef hook properly in react Functional Component?
I have a JavaScript snippet and I’m trying to implement the same in react. Here is the snippet. For more details about the snippet, please refer this codepen. When I scroll I’m just adding a class to the an element and removing when a certain condition is met using scroll eventListerner. Here is how I tried in react with the