I have a dashboard running under 2.9 that displays data from a database , a function returns a data structure that is used to build the table. The function that returns the data includes icons in the data using this code
New-UDIcon -Icon check_circle -Color green -Size 2x
when I exclude these from the data my table displays with no issue , however when I include them I get a react error
Objects are not valid as a React child (found: TypeError: Cannot read property ‘scrollWidth’ of null). If you meant to render a collection of children, use an array instead.
Below is a more details including a JSON representation of the data I am using to populate the table and the code I am using to create the table.
Can anyone tell me what needs to change to get icons displaying in a table in 3.x like they do in my 2.9 page?
The data I use to populate the table looks like this , this is a JSON representation I outputted for debugging.
…
{
“PatchingHealth”: {
“listItem”: false,
“inverse”: false,
“size”: “2x”,
“rotation”: 0,
“border”: false,
“style”: null,
“pulse”: false,
“id”: “ccb773e9-7941-4e57-94e0-92a4fab60bda”,
“title”: “”,
“icon”: “ExclamationCircle”,
“type”: “icon”,
“transform”: “”,
“fixedWidth”: “False”,
“spin”: false,
“pull”: “”,
“className”: “”,
“flip”: “”,
“regular”: false,
“color”: “rgba(255, 0, 0, 1)”
},
“PatchesFailed”: 1,
“os”: {
“listItem”: false,
“inverse”: false,
“size”: “2x”,
“rotation”: 0,
“border”: false,
“style”: null,
“pulse”: false,
“id”: “963be812-e2e2-4e70-a9e0-0e462ce48894”,
“title”: “”,
“icon”: “Linux”,
“type”: “icon”,
“transform”: “”,
“fixedWidth”: “False”,
“spin”: false,
“pull”: “”,
“className”: “”,
“flip”: “”,
“regular”: false,
“color”: null
},
“PatchesMissing”: 1,
“PatchDate”: “2020-09-13T00:00:00”,
“ServerName”: “Redacted”,
“PatchingStatus”: “Patching Failed See Associated Incident”,
“PatchesScheduled”: 0,
“PatchesInstalled”: 0
}
…
The code I am running to build the table is :
New-UDPage -Name “tabledata” -Content {
# $Session:Data | ConvertTo-Json | Out-File “c:\temp\data.txt”
$Session:Now = Get-Date
$Session:LastData = ParseSQLData -BP_ID ‘[Redacted]’ -PatchMonth ‘9’ -PatchYear ‘2020’ -GetCurrentDate $Session:Now
$Session:LastData | ConvertTo-Json | Out-File "c:\temp\data.txt"
$Session:Columns = @(
New-UDTableColumn -Property os -Title 'OS'
New-UDTableColumn -Property ServerName -Title 'Server Name'
New-UDTableColumn -Property PatchDate -Title 'Patch Date'
New-UDTableColumn -Property PatchesMissing -Title 'Patches Missing'
New-UDTableColumn -Property PatchesInstalled -Title 'Patches Installed'
New-UDTableColumn -Property PatchesFailed -Title 'Patches Failed'
New-UDTableColumn -Property PatchesScheduled -Title 'Patches Scheduled'
New-UDTableColumn -Property PatchingHealth -Title 'Patching Health'
)
New-UDTable -Id 'LastPatchData' -Data $Session:LastData -Columns $Session:Columns
}