I tried to create a component ‘Card’ and use it like a container. the code work well without ‘card’. when I tried to add it the ‘Card.css’ and expense-item in ExpenseItem.css doesn’t work this is ‘ExpenseItem.js’: this is ‘Card.js’: and this is ‘Card.css’: and finally this is ‘ExpenseItem.css’: Answer You need a space between card and the class name in
Tag: reactjs
React hooks in dynamic lists – more hooks than previous render
Looking for an approach that allows me to use state hooks in dynamic lists of functional components. As my code stands a re-rendering of the list gives errors concerning changing numbers of hooks. I have a master component that renders a list of Functional components, the length of the list depends on the state held by the master, and that
Uncaught TypeError: Cannot read properties of undefined (reading ‘toString’)
I am developing a React app and I don’t know how to solve this error. I’m pretty sure it’s from my useEffect function, but I can’t figure out what’s wrong. Any help would be much appreciated, thank you! Answer The problem isn’t in this part of the code. In error, you can see that problem is when you try to
Show and Hide Condition in React
I have a simple problem here which I can’t figure out. I wanted to hide menus depending on the condition. For example if status contains at least one “Unlinked”. “All unlinked images” menu should appear. I did used .some and I wonder why it doesn’t return a boolean. Codesandbox is here Click here Answer The methods do return a boolean.
How to fix “TypeError: props.scoreboard.map is not a function”, only after refresh
I’m having an odd issue when I’m trying to loop over my response from my backend. I’ve seen similar questions and they seem to point to the response not being an array, but logging my response does indeed result in an array. I’m passing the scoreboard prop to the scoreBoardItem which will map over the props and return what I
RangeError: Maximum call stack size exceeded (getting this error on multiple async/await calls)
RangeError: Maximum call stack size exceeded On using multiple async/await i am getting error RangeError: Maximum call stack size exceeded I think the stack size is fulled on calling so many async functions but if not so how do i achieve same functionality that this code would have achieved if it doesn’t get any error Code attached below: Answer Your
React Native, how to get values from multiple TextInputs into one object by pressing a Button?
I’m trying to put values from different TextInput’s into 1 object. I’m new to React in general and don’t have a firm grasp of states yet. So far my code is like this: Answer You’re really close! What you want (enteredText) shouldn’t actually be a state. It logically flows from the first and second texts, so you can just have
Unable to batch.delete documents of a subcollection
I have a collection called display and each document inside the display has a subcollection called history. There’s no error, though, it does not delete the documents in Firestore. After selecting the row to be deleted, it is gone when you click delete. However, once you reload the screen, the data deleted was still there, meaning it wasn’t successfully deleted
Send Data to a Server using Fetch API in React Native
I want to send data of Contact Form[firstname,lastname,email,note] to a server but When I click Contact Button to Send data I got an e=Error Telling that firstname is not defined The mean that all the 5 variables not defined if Some Can Help This The Code of FormScreen.js: This is The Error : enter image description here Answer It is
Creating Plugins in React
I am learning React. I have experience with Vue.js. Vue.js has the concept of plugins which allow you to inject functionality across pieces of your app. The pieces may be components, state management, router, etc. A common need for plugins is translation or logging. My question is, does React have a concept like plugins or services? If so, what is