In the midst of building a React-datagrid project, I am streamlining CSS properties for an array. However, there seems to be redundant CSS properties that I would like to consolidate into an array format.
let _columns = [];
let commonStyle = {"width":"200","height":"300"};
_columns.push({
style:commonStyle
});
When adding new properties, you can directly write them out:
_columns.push({
width: 200
});
This method works, or you can use a variable (holding a single property value) like this:
let commonWidth = 200;
_columns.push({
width: commonWidth
});
However, I am facing issues when trying to utilize an array like 'commonStyle' with multiple properties/values. Is my syntax incorrect? Even when reducing the array to a single property, such as:
let commonStyle = {"width":"200"};
the style does not seem to apply... What could be causing this issue?