Skip to content

Commit 506a8fd

Browse files
authored
Fix crash in controlled ColorField docs examples (#6732)
1 parent 8ee8471 commit 506a8fd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react-aria-components/docs/ColorField.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ function Example() {
234234
return (
235235
<>
236236
<MyColorField label="Color" value={color} onChange={setColor} />
237-
<p>Current color value: {color.toString('hex')}</p>
237+
<p>Current color value: {color?.toString('hex')}</p>
238238
</>
239239
);
240240
}
@@ -262,7 +262,7 @@ function Example() {
262262
<MyColorField label="Saturation" value={color} onChange={setColor} colorSpace="hsl" channel="saturation" />
263263
<MyColorField label="Lightness" value={color} onChange={setColor} colorSpace="hsl" channel="lightness" />
264264
</div>
265-
<p>Current color value: {color.toString('hex')}</p>
265+
<p>Current color value: {color?.toString('hex')}</p>
266266
</>
267267
);
268268
}

0 commit comments

Comments
 (0)