reflex icon indicating copy to clipboard operation
reflex copied to clipboard

Cannot index dict for props from State object

Open Cheesy-Brik opened this issue 3 years ago β€’ 3 comments

Error:
  x Expected unicode escape
    ,----
 45 | <Center sx={{"paddingBottom": "15%", "bg": state.palette[\"bg2\"], "height": "100vh", "width": "100wh"}}><VStack spacing="1.5em"
    :                                                          ^
    `----

Caused by:
    0: failed to process input file
    1: Syntax Error

You get an error like this when trying to index from a State dict for prop values, object is a State computed var and is type hinted with dict.

Cheesy-Brik avatar Feb 18 '23 02:02 Cheesy-Brik

Solution would maybe be to get rid of the backslahes? Idk, can the css even access state props?

Cheesy-Brik avatar Feb 18 '23 02:02 Cheesy-Brik

Got it thanks for pointing this out

Alek99 avatar Feb 18 '23 09:02 Alek99

It is related to this PR. https://github.com/pynecone-io/pynecone/pull/683

d29107d avatar Mar 16 '23 07:03 d29107d