Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jlatiav opened this issue Oct 28, 2024 · 0 comments
Open

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

jlatiav opened this issue Oct 28, 2024 · 0 comments

Comments

@jlatiav
Copy link

jlatiav commented Oct 28, 2024

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant