reflex icon indicating copy to clipboard operation
reflex copied to clipboard

pc.responsive_grid column component can't take in a list of vars

Open DPetuskey opened this issue 3 years ago β€’ 1 comments

Describe the bug I try to pass in a State variable based on some user input into the "columns" component of pc.responsive_grid and I get a typeError. It expects a List[int] type but when I pass in a List of integers that are state vars it errors.

TypeError: Invalid var passed for prop columns, expected type pynecone.var.Var[typing.List[int]], got value [BaseVar(name='size', type_=<class 'int'>, state='state', is_local=False, is_string=False)] of type <class 'list'>.

Expected behavior Expect my pc.responsive_grid to update column size based on input into a State var.

Screenshots Screen Shot 2022-12-29 at 5 42 08 PM

** Specifics (please complete the following information):**

  • Python Version: 3.11
  • Pynecone Version: 1.10
  • OS:
  • Browser (Optional):

Additional context Add any other context about the problem here.

DPetuskey avatar Dec 30 '22 01:12 DPetuskey

Got it, I can fix this for the next release

Alek99 avatar Dec 30 '22 01:12 Alek99

closing this as it was fixed

ElijahAhianyo avatar Aug 17 '23 16:08 ElijahAhianyo