Skip to content

Commit 9cbc777

Browse files
authored
remove vstack from around progress (#1215)
1 parent 4d38e5f commit 9cbc777

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

docs/vars/var-operations.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -392,9 +392,7 @@ class GetItemState1(rx.State):
392392
list_1: list = [50, 10, 20]
393393

394394
def get_item_error_1():
395-
return rx.vstack(
396-
rx.progress(value=GetItemState1.list_1[0])
397-
)
395+
return rx.progress(value=GetItemState1.list_1[0])
398396
```
399397

400398
In the code above you would expect to index into the first index of the list_1 state var. In fact the code above throws the error: `Invalid var passed for prop value, expected type <class 'int'>, got value of type typing.Any.` This is because the type of the items inside the list have not been clearly defined in the state. To fix this you change the list_1 definition to `list_1: list[int] = [50, 10, 20]`
@@ -404,9 +402,7 @@ class GetItemState1(rx.State):
404402
list_1: list[int] = [50, 10, 20]
405403

406404
def get_item_error_1():
407-
return rx.vstack(
408-
rx.progress(value=GetItemState1.list_1[0])
409-
)
405+
return rx.progress(value=GetItemState1.list_1[0])
410406
```
411407

412408
### Using with Foreach

0 commit comments

Comments
 (0)