Skip to content
This repository was archived by the owner on Apr 28, 2026. It is now read-only.

Commit ccb13f9

Browse files
committed
remove those references from docs as well
1 parent e45d7a2 commit ccb13f9

2 files changed

Lines changed: 19 additions & 10 deletions

File tree

docs/enterprise/drag-and-drop.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,12 @@ def state_tracking_example():
216216
Create dynamic draggable lists using `rx.foreach`:
217217

218218
```python demo exec
219+
import dataclasses
219220
import reflex as rx
220221
import reflex_enterprise as rxe
221222

222-
class ListItem(rx.Base):
223+
@dataclasses.dataclass
224+
class ListItem:
223225
id: str
224226
text: str
225227
list_id: str

docs/getting_started/dashboard_tutorial.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ You can see what the finished app and code will look like here:
2727

2828

2929
```python exec
30+
import dataclasses
3031
from collections import Counter
3132

32-
class User(rx.Base):
33+
@dataclasses.dataclass
34+
class User:
3335
"""The user model."""
3436

3537
name: str
@@ -181,7 +183,8 @@ rx.vstack(
181183
import reflex as rx
182184
from collections import Counter
183185

184-
class User(rx.Base):
186+
@dataclasses.dataclass
187+
class User:
185188
"""The user model."""
186189

187190
name: str
@@ -616,14 +619,15 @@ So far our data has been defined in a list of lists, where the data is accessed
616619

617620
A better way to structure our data in Reflex is to use a class to represent a user. This way we can access the data using attributes i.e. `user.name`, `user.email`.
618621

619-
In Reflex when we create these classes to showcase our data, the class must inherit from `rx.Base`.
620-
621-
`rx.Base` is also necessary if we want to have a state var that is an iterable with different types. For example if we wanted to have `age` as an `int` we would have to use `rx.base` as we could not do this with a state var defined as `list[list[str]]`.
622+
In Reflex when we create these classes to showcase our data, we can use dataclasses.
622623

623624
The `show_user` render function is also updated to access the data by named attributes, instead of indexing.
624625

625626
```python exec
626-
class User(rx.Base):
627+
import dataclasses
628+
629+
@dataclasses.dataclass
630+
class User:
627631
"""The user model."""
628632

629633
name: str
@@ -670,7 +674,8 @@ rx.table.root(
670674

671675

672676
```python
673-
class User(rx.Base):
677+
@dataclasses.dataclass
678+
class User:
674679
"""The user model."""
675680

676681
name: str
@@ -1119,7 +1124,8 @@ rx.vstack(
11191124
```
11201125

11211126
```python
1122-
class User(rx.Base):
1127+
@dataclasses.dataclass
1128+
class User:
11231129
"""The user model."""
11241130

11251131
name: str
@@ -1663,7 +1669,8 @@ rx.vstack(
16631669
import reflex as rx
16641670
from collections import Counter
16651671

1666-
class User(rx.Base):
1672+
@dataclasses.dataclass
1673+
class User:
16671674
"""The user model."""
16681675

16691676
name: str

0 commit comments

Comments
 (0)