Here is the parent code: Here is the child code: The expected result is that: When the user picks a month from the MonthPicker, the parent component submit the select month and year to server. Get the result from the server and then send the result to the child component. The actual result is that the child c…
Tag: reactjs
how to filter an nested objects inside an array in javascript
I have the following nested objects in an array and i want to filter the result to return the id of a specific item. The solution i tried is returning null because of the nested objects structure i presume P.S: The structure of the data above is from the backend that iam working with. I am a beginner with jav…
React Module parse failed: Unexpected token (1:48)
Can someone help me? I just create react app then I start it immediately. Then I got an error something like this. I don’t know much about webpack. CMD I just type npx create-react-app ./ in the directory then npm start then this error happened. I have tried to make 3 react app and same thing happened a…
Socket in react is not listening for the second time
I’m very new to socket and trying to integrate socket in react and node.js simple CRUD application. My backend always emits the event and Frontend listens to the event. Below is the scenario I’m deleting an item from the list and for which I’m emitting an event from Backend after the record …
Have small images moving around independently inside a div
I have a div, about 500px x 300px and that has 5 small img inside it, I’m wondering if there is a function or animation or something that I could apply, so that all 5 images would be dancing around moving around independently of each other continually, I’ve tried translateX / Y with a random numbe…
Data not saved with redux react for android
I probably missunderstood how does redux works but my datas are not saved into the store and i quit et re-open the app. Everything works perfectly when i keep my app open (I can add sessions, exercices…) and everything is saved but when i close it there’s no data. Do i’ve to write some code …
How can I implement a “as” prop with TypeScript while passing down the props?
I am building a library of components and I need some of them to have a customizable tag name. For example, sometimes what looks like a <button> is actually a <a>. So I would like to be able to use the button component like so: Ideally, I would like the available props to be inferred based on the …
How do you use React context inside App.js file?
I am building a multi-language app. I am using react-intl. So far, so good. I made a state of the language with context api, so I can switch it easily. However I get this error when I try to use the state in App.js: TypeError: Object is not iterable (cannot read property Symbol(Symbol.iterator)). Here is my c…
How to avoid input value reset in Reactjs?
I am referring to this tutorial for simple react autocomplete https://www.digitalocean.com/community/tutorials/react-react-autocomplete But I have a slightly different requirement. Instead of typing something on the input field, I want all the suggestions to come up on clicking the input field. I am basically…
Line break in a CardHeader element subtitle (MaterialUI / ReactJS)
I’m using pretty old Material UI (Ver. 0.20.1) components. Here’s a chunk of my code: So i have a subtitle string with a bunch of variables in it that i wanted to use a line break to separate visually but adding n or even ‘…string’ + <br/> + ‘string…’ does…