Due to limitations with next js, data could not be passed to client without being converted to string. So date obtaned from database is is now a string: I use new Date() to get the current date and convert it to string as well (Notice T is missing from my string date) In both cases, I the code below to
Tag: reactjs
How to push to a child node while updating values in the parent node Firebase RealTime
I am trying to update the values in the parent node of a firebase realtime db while simultaneously pushing data to a child node, however I get the error “Reference.update failed: First argument contains a path /xyz that is ancestor of another path /xyz/…/…” And my data is structured as so: Answer Your updates contains these two keys: It helps
API called twice while useEffect triggered once. ReactJS/Javascript
i am building a project, in which when user click the buyNow button in Basket (child 2) it will pass the props back to parent where it further pass it to another child in Signin(child 3) where we call an API call(inside useEffect) to update the mysql database but it seems that the API call is called twice as in
Text Sliders front-end using React
I’m learning basics of react and currently im exploring certain problem statements available on the internet. One such problem statement required me to create a react app for a text slide creator with previous , next and reset buttons. I was able to create till here – My app.js file looks something like this- and my SlideComponent.js looks something like
/Reactjs fetching bringing a 405 status code in browser
I am developing a react app over DHIS2 and data online that is structured like: I am trying to update the whole attributeValues Node. I’m using a fetch request, but getting 405 method not allowed What do you suppose i’m doing wrong. This is the fetch post request i wrote. If the question happens to be a duplication, please direct
React Hook – multiple “useEffect” fires at componentDidMount
I’m using multiple useEffect hooks to perform the componentDidMount and componentDidUpdate functionalities, however, looks like when component loads, all my useEffect fires initially… when my component mounts, I see all those console log there How could I only let my first useEffect fires, but the other three fires when the dependency changes only? Answer useEffect is not a direct replacement
SemanticUI Button still active after clicked
When you click on the button, it becomes gray and stays so unless you click somewhere else. Is it possible to make it return to the initial state(light gray) right after you clicked? Answer Any <button> (not just ones from Semantic-UI) has a number of different states it can be in. These states can be selected and styled with pseudo-classes
array.list.concat() is removing two elements in json
I am trying to store two new elements into a json object which is called shirt, it is created by filtering from my database like below: I then use states and create colors and size and create two elements for the two in the json object shirts as below: but if i console.log(shirts) i get this response: and if i
items not being displayed on table
I’ve been trying to create this search app where I can display the items in a table and delete items using react redux. However, on the initial load, the app shows a table but there is no data in the table. It’s an empty table. If i search for another movie name which have more than one movie for that
How to make a “global” component render content based on url route?
I have a FAQ button that’s fixed onto the bottom right corner of the screen (it’s on every screen of the website), when clicked a modal pops out displaying frequent asked questions and their respective answers, I’d like the modal to display different content based on the url that the user is on. For example: if the user is on