Skip to content

Commit 7336849

Browse files
authored
fix(docs): cleanup warnings in docs (#6857)
* fix various docs warnings * typo
1 parent a4d8b94 commit 7336849

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

packages/@react-aria/color/docs/useColorField.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ The following examples show how to use the `ColorField` component created in the
108108
By default, `ColorField` is uncontrolled. You can set a default value using the `defaultValue` prop.
109109

110110
```tsx example
111-
<ColorField defaultValue="#7f007f" />
111+
<ColorField aria-label="Color" defaultValue="#7f007f" />
112112
```
113113

114114
### Controlled
@@ -124,7 +124,7 @@ function Example() {
124124
let [color, setColor] = React.useState(parseColor('#7f007f'));
125125
return (
126126
<>
127-
<ColorField value={color} onChange={setColor} />
127+
<ColorField aria-label="Color" value={color} onChange={setColor} />
128128
<p>Current color value: {color.toString('hex')}</p>
129129
</>
130130
);
@@ -137,8 +137,8 @@ A `ColorField` can be disabled using the `isDisabled` prop, and made read only u
137137
The difference is that read only color fields are focusable but disabled color fields are not.
138138

139139
```tsx example
140-
<ColorField defaultValue="#7f007f" isDisabled />
141-
<ColorField defaultValue="#7f007f" isReadOnly />
140+
<ColorField aria-label="Color" defaultValue="#7f007f" isDisabled />
141+
<ColorField aria-label="Color" defaultValue="#7f007f" isReadOnly />
142142
```
143143

144144
### HTML forms

packages/@react-aria/dnd/docs/useDraggableCollection.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ let getItems = (keys) => (
290290

291291
<ListBox aria-label="Adobe Apps" items={items} getItems={getItems} selectionMode="multiple">
292292
{([id, item]) => (
293-
<Item key={id}>
293+
<Item key={id} textValue={item.name}>
294294
<item.style>{item.name}</item.style>
295295
</Item>
296296
)}

packages/@react-aria/dnd/docs/useDroppableCollection.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ function Example() {
737737
onRootDrop={onRootDrop}
738738
onInsert={onInsert}>
739739
{item => (
740-
<Item>
740+
<Item textValue={item.name}>
741741
<div className="image-item">
742742
<img src={item.url} />
743743
<span>{item.name}</span>
@@ -813,7 +813,7 @@ function Example() {
813813
///- end highlight -///
814814
onRootDrop={onRootDrop}>
815815
{item => (
816-
<Item key={item.name}>
816+
<Item key={item.name} textValue={item.name}>
817817
<div className="dir-item">
818818
{item.kind === 'directory' ? <Folder /> : <File />}
819819
<span>{item.name}</span>
@@ -897,7 +897,7 @@ function Example() {
897897
acceptedDragTypes={['image/png']}
898898
onRootDrop={onRootDrop}>
899899
{item => (
900-
<Item>
900+
<Item textValue={item.name}>
901901
<div className="image-item">
902902
<img src={item.url} />
903903
<span>{item.name}</span>
@@ -1015,7 +1015,7 @@ function Example() {
10151015
getDropOperation={getDropOperation}
10161016
onDrop={onDrop}>
10171017
{item => (
1018-
<Item>
1018+
<Item textValue={item.name}>
10191019
<div className="dir-item">
10201020
<Folder />
10211021
<span>{item.name} ({item.contains} items)</span>

packages/@react-aria/gridlist/docs/useGridList.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ function ExampleList(props) {
375375
return (
376376
<List aria-label="Example dynamic collection List" selectionMode="multiple" items={rows} {...props}>
377377
{item => (
378-
<Item>
378+
<Item textValue={item.name}>
379379
{item.name}
380380
<Button onPress={() => alert(`Info for ${item.name}...`)}>
381381
Info

packages/@react-spectrum/avatar/docs/Avatar.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Sizes can either be one of the predefined avatar size variables, or a custom siz
7272
```tsx example
7373
<Flex gap="size-100" wrap>
7474
{[50, 75, 100, 200, 300, 400, 500, 600, 700].map(size => (
75-
<Avatar src="https://i.imgur.com/kJOwAdv.png" alt="default Adobe avatar" size={`avatar-size-${size}`} />
75+
<Avatar key={size} src="https://i.imgur.com/kJOwAdv.png" alt="default Adobe avatar" size={`avatar-size-${size}`} />
7676
))}
7777
<Avatar src="https://i.imgur.com/kJOwAdv.png" alt="avatar with custom size" size={50} />
7878
</Flex>

packages/@react-spectrum/combobox/src/ComboBox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ const ComboBoxBase = React.forwardRef(function ComboBoxBase<T extends object>(pr
170170
validationState={props.validationState || (isInvalid ? 'invalid' : null)}
171171
ref={inputGroupRef} />
172172
</Field>
173-
{name && formValue === 'key' && <input type="hidden" name={name} value={state.selectedKey} />}
173+
{name && formValue === 'key' && <input type="hidden" name={name} value={state.selectedKey ?? ''} />}
174174
<Popover
175175
state={state}
176176
UNSAFE_style={style}

packages/@react-spectrum/table/docs/TableView.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Basic usage of TableView, seen in the example above, shows the use of a static c
8282

8383
Columns and rows can be statically defined as children, or generated dynamically using a function based on the data passed to the `columns` or `items` prop respectively. Cells can also be statically defined as children, or generated dynamically based on the columns defined in the TableHeader.
8484

85-
Each column and row has a unique key defined by the data. In the example below, the `uid` property of the column object is used as the `key` for the Column element within the TableHeader. The `key` of each row element is implicitly defined by the id property of the row object. See [collections](../react-stately/collections.html#unique-keys) to learn more keys in dynamic collections.
85+
Each column and row has a unique key defined by the data. In the example below, the `uid` property of the column object is used as the `key` for the Column element within the TableHeader. The `key` of each row element is implicitly defined by the id property of the row object. See [collections](../react-stately/collections.html#unique-keys) to learn more about keys in dynamic collections.
8686

8787
```tsx example
8888
let columns = [

packages/@react-spectrum/tabs/docs/Tabs.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ Icons can also be used in `Tabs` in addition to a text label. Tabs use [Slots](.
121121
```tsx example
122122
<Tabs aria-label="History of Ancient Rome">
123123
<TabList>
124-
<Item key="FoR"><Bookmark /><Text>Founding of Rome</Text></Item>
125-
<Item key="MaR"><Calendar /><Text>Monarchy and Republic</Text></Item>
126-
<Item key="Emp"><Dashboard /><Text>Empire</Text></Item>
124+
<Item key="FoR" textValue="FoR"><Bookmark /><Text>Founding of Rome</Text></Item>
125+
<Item key="MaR" textValue="MaR"><Calendar /><Text>Monarchy and Republic</Text></Item>
126+
<Item key="Emp" textValue="Emp"><Dashboard /><Text>Empire</Text></Item>
127127
</TabList>
128128
<TabPanels>
129129
<Item key="FoR">

0 commit comments

Comments
 (0)