I'm ignorant towards how Reacts render works and i was wondering , how or if it possible to update a style element from a variable created in a function. See the following :
this is my function that's called in order to determine the amount of columns for the sytle elemnt "gridTemplateColumns".
function getSize() {
var number 10
var ColumnNo= "";
for (var i = 0; i < number; i++) {
ColumnNo+= "auto ";
}
}'
And this is the Grid Container with the style inside:
<div className="grid-container" style={{ "gridTemplateColumns": styletest }}>
I know that it works when you load the page , but how do you update the render with this new variable ?