Skip to content

Rendering Dash html.A elements results in runtime error #6

@jlatiav

Description

@jlatiav

Contrary to the normal Dash Mantine Components table, using Dash html.A elements in Dash Mantine React table results in a runtime error.

MWE

import dash
from dash import html
from dash_mantine_react_table import DashMantineReactTable

app = dash.Dash(__name__)

rows = [
    {
        "Description": "Test 1",
        "Link": html.A(
            "Link to Test 1",
            href="https://example.com/browse/test-1",
            target="_blank",
            rel="noopener noreferrer",
        ),
    },
]

app.layout = html.Div([
    DashMantineReactTable(
        data=rows,
        columns=[
            {"accessorKey": "Description", "header": "Description"},
            {"accessorKey": "Link", "header": "Link"},
        ],
    )
])

if __name__ == '__main__':
    app.run_server(debug=True)

This results in the following error

Objects are not valid as a React child (found: object with keys {props, type, namespace}). If you meant to render a collection of children, use an array instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions