I have this table: the file is importing my css file, styles.scss: I found instructions to add this in .css to max out the height and when the height is reached, start a scroll bar, but it’s not working. Does this work with a SCSS file? Answer On the .table tag in your CSS page, make sure that display: …
Tag: reactjs
Trying to fetch API via axios, but don’t know how to access
I try to fetch some data from an API. The API is formatted like this: And in react my app.js looks like this: And the ItemsGrid: So nothing is to see beacause I don’t know how to access the array. In the console log I see there is something: Anyone know how to show the names via mapping? Answer If
How do I clear a leaflet map in react so I can map fresh data?
I am attempting to clear a leaflet map in react when fetching new data to map, and i am unsure how to approach this. I saw this post but not sure how exactly to apply it. Right now I have a function that fetches 1 of 2 geojsons I have loaded. App.js This is merely a test to get the
Reloading DeckGL HexagonLayer when data array changes/Triggering reload for DeckGL HexagonLayer
I’m using DeckGL with React to display some data on an OpenStreetMap. I’m planning on implementing some filters to be able to display different views on the data I have. My main problem is, that I can’t figure out how to refresh the data representing layer after filtering the data array. I s…
How to start item index with 1
I’m iterating through array “fruits”. I want its index to start with 1. but the output starts at 0. Here is my code here is the output. how do i make it to start with 1 ? Answer Manually add 1 to the index:
unable to update hooks variable when fetching multiple urls in react
I am trying to store data from the TMDB movie api using a custom react hook . useFetch.js When I console.log({promises}) I get this object where the 2 items are the movie types with 20 movies inside : And then when I try to display the movies from the object above in another component : MovieList.js I get not…
How to show the sum of the values for the same item and for different dates in react.js
I have the array: And I want to be able to display the data as shown in the table: ITEM 202001 202002 TOTAL I1 100 200 300 I2 – 300 300 TOTAL 100 500 600 I tried to show the values of each date for the same item, now I need the above to calculate the subtotals and the total.
aws cdk nextjs graphql mutation cannot return null for non-nullable type after adding in new schema field
I have tried to modify the schema to add a ingredients String line. From this code I am pretty much following it to a tee https://github.com/dabit3/next.js-cdk-amplify-workshop you can look in the backend and frontend folders to see all the code I have built and deployed with cdk My error is at the bottom Any…
react-markdown and renderers with arguments
I am using React Markdown (https://www.npmjs.com/package/react-markdown) to render markdown content in my NextJS project. I have created a simple component named “ImageRenderer” and I need to pass an argument (in this case the slug) in addition props, to this component but I do not know how: My pa…
How to use Link and Route inside of condition term
So I am trying to move through pages in react, my goal is when I did validate the things I need (name, and number) the page will switch and I will be in another route. (without refresh the page). I tried to do it with window.location but its refreshing the page I cant use <Link> because I want to switch