Skip to content

Tag: reactjs

Must I use arrow functions in this.setState in React?

As I am following an example in React’s documentation on using this.setState to toggle an on/off button. I am experimenting with non-arrow functions in this.setState but have difficulty understanding why non-arrow functions wouldn’t work, or if something needs to be added to a non-arrow function t…

Remove padding from chartjs bar chart canvas

I want to create a single stacked bar chart with Chart.js that shows how close someone is to a certain amount of money. To define this amount I put a dotted line on top of the chart. The problem is however that the canvas of this chart has some unwanted padding. So the line spills over outside of the chart.

How to scroll to the desired element in React?

I have a question – I have a list that is in a separate popup with a limited height. After this height, a side scroll appears. I need to scroll to a specific element automatically when that component is rendered. How to implement it? I just can’t figure out how to scroll to a certain element. Belo…

Change the color of elements in Select from MUI

It seems that there were quite a lot of questions and answers on this topic, but I could not find anything suitable for myself. I ask the community for help. I’m using the Select component from @mui/material to display the number of records per page. And I’d like to change the color of the window&…