Skip to content

TODOMVC in ReactPy #976

Answered by rmorshea
metaperl asked this question in Question
May 14, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

The main difference between Solara and ReactPy is that Solara was built to integrate with the existing Jupyter Widget ecosystem. Most of the differences between ReactPy and Solara arise from this fact. However, both attempt to replicate the API of React and thus will this look fairly similar.

With that said, here's my take on a simple todo app:

from __future__ import annotations
from dataclasses import dataclass
from typing import Any, TypeAlias

import reactpy as rp

TodoItems: TypeAlias = "tuple[TodoItem, ...]"
TodoItemState: TypeAlias = "rp.types.State[TodoItems]"

PICO_CSS = rp.html.link(
    {
        "rel": "stylesheet",
        "href": "https://cdn.jsdelivr.net/npm/@picocss/pico@1…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@metaperl
Comment options

Answer selected by metaperl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants