Skip to content

Commit 106bb89

Browse files
Fix color picker ReferenceError by using NoSSRComponent (#1300)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Alek Petuskey <[email protected]> Co-authored-by: Alek Petuskey <[email protected]>
1 parent 2dccc8b commit 106bb89

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

docs/wrapping-react/overview.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ We also have a var `color` which is the current color of the color picker.
5959
Since this component has interaction we must specify any event triggers that the component takes. The color picker has a single trigger `on_change` to specify when the color changes. This trigger takes in a single argument `color` which is the new color.
6060

6161
```python exec
62-
class ColorPicker(rx.Component):
62+
from reflex.components.component import NoSSRComponent
63+
64+
class ColorPicker(NoSSRComponent):
6365
library = "react-colorful"
6466
tag = "HexColorPicker"
6567
color: rx.Var[str]
@@ -87,7 +89,9 @@ rx.box(
8789
```
8890

8991
```python
90-
class ColorPicker(rx.Component):
92+
from reflex.components.component import NoSSRComponent
93+
94+
class ColorPicker(NoSSRComponent):
9195
library = "react-colorful"
9296
tag = "HexColorPicker"
9397
color: rx.Var[str]
@@ -147,4 +151,4 @@ export default function App() {
147151

148152

149153

150-
In the next page, we will go step by step through a more complex example of wrapping a React component.
154+
In the next page, we will go step by step through a more complex example of wrapping a React component.

pcweb/whitelist.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
WHITELISTED_PAGES = []
1414

15-
1615
def _check_whitelisted_path(path: str):
1716
if len(WHITELISTED_PAGES) == 0:
1817
return True

0 commit comments

Comments
 (0)