Skip to content

Tag: reactjs

Remove outline only on click event

I would like to remove the focusable HTML tags’ outline only when focus is triggered by a click event. This means I would like to keep outline for tabbing. Does anyone know a practice or library I could use here? If not, my idea is attaching an event listener to window that listens to click events and i…

React – Too many re-renders when using props

I have been doing a project where I present a graph on the screen. Now, the data state within the App.js is being passed as a prop and then causes an infinite loop error. If the data variable is within the Graph.js file and used and defined within the useState, then there is no issue. I was a bit uncertain

React how to create a data for chart?

I have a line chart react-google-charts. This chart accepts the data in the form of: And I get data from API. This data returns; How can I fit this array as chart data? Answer Something like this may work: PS. you may need to reformat your date

How to filter data using multiple values in React.JS

I have a huge set of JSON data which I consider to be pretty complex when it comes to filtering data out of it. The idea is to take inputs from the user from the District, Ward No, and Categories dropdowns and use those to filter out the data i.e (grievances, general, urgent, and service), and display their p…