I have a screen which has two divs: top navbar (80px in height) and a div component below the navbar (remaining screen height). Since I am using tailwind formatting looks something like this: The problem, navbar is 80px and bottom content is dynamic but a white gap appears at the bottom. White gap will disappear if using h-screen (100% vw).
Tag: reactjs
Multiple conditions/operators to show/hide html elements in React (NextJS)
I’m looking to display some html in my React/Next.js web app based on conditional logic. I got the basics working but having issues showing the same html if multiple variable conditions are true. For example, the following code works fine. I’m having issues showing multiple variables as true. The following code doesn’t work but show the logic I’m after. I
Im trying to add an onClick function on the button so if the user clicks Yes, it removes the two buttons then add two new inputs field react js
this is the first code with the buttons elements while this is where the button component is called and rendered, i think this is where the logic will happen export default RightBody; again what I want to do is that onClick of the yes button, I want to display two input fields instead of the two buttons originally there. Theres
how to properly handle input dependent async data calls in react component?
I am currently building some apps using Typescript and React. To this date i have used some smelly workarounds for the following situation which i would like to get rid of. Maybe you know a better way of doing such. The Setup: Having a React Component which sould display data which is fetched from server on user input. Example use
I cant get my state updated synchronously and it just performs on next render in React
I want my react states to be updated immediately as soon as I refactor the data in them so that I can run the functions in correct order, otherwise, when it performs the next function I declared, it will just execute the undefined or null data since its not yet updated. How can I fix this issue? I know some
Why cant i use a function to fill a table in REACTJS
I wrote a function in REACTJS that helps me to read a JSON-File and to display the content of the JSON-File. When I use the code of the function inside of a body the display of the content works fine. But now i want to use the function to fill a table with the content of the JSON and it
How to load/populate an existing database record to a ReactJs form
I got this form where you can update user data (code, article, price, vat, status, companyid). I would like to populate the Update/Edit form with user data so i can easly modify them (once this form shows up, i would like to get data from API in each input and show them as input value). src/Service/api.js: Answer Create a new
Looping elements in JSX React
In React.js documentation, I wonder how Array.map() is used in JSX React. in <ul> tag, why we just put the variable listItems directly?. Because I think it will return a single array instead of <li> elements like this : how does JSX treat an array? Did I have to loop listItems manually? Thank you in advance. Answer you might want
“cover” property bugging the background
I am having a problem with covering the background in CSS. Before: Image Before After: Image After Anyone know how to fix this? Thanks! Answer You cannot have cover alone in the background property. You are obliged to define the position as well: Or add background-size: cover Related: Error: CSS: background: / is an incorrect operator
Array of components doesn’t update when props change
Codesandbox link I have two components, a Parent and a Child. The Parent components keeps a list of Children in state and renders it using the map method. The parent: The Child: Clicking the “add child” button adds an child to the children array. Clicking the “increment” button updates the counter on the parent, but the counter in the children