Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 393f7e9

Browse files
committed
fix last warnings
1 parent f4bda7d commit 393f7e9

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

docs/src/examples/components/Ref/Types/RefForwardingExample.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import { Grid, Ref, Segment } from '@stardust-ui/react'
33

4-
const ExampleButton = React.forwardRef<HTMLButtonElement>((props, ref) => (
4+
const ExampleButton = React.forwardRef<HTMLButtonElement, { children: string }>((props, ref) => (
55
<div>
66
<button {...props} ref={ref} />
77
</div>

docs/src/prototypes/popups/GridImagePicker/GridImagePicker.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { ShorthandValue } from '../../../../../types/utils'
66
import GridImagePickerItem, { GridPickerItemProps } from './GridImagePickerItem'
77

88
export interface GridPickerProps {
9-
as?: keyof React.ReactHTML
109
items: GridPickerItemProps[]
1110
gridColumns?: string | number
1211
inputIcon?: ShorthandValue
@@ -27,7 +26,6 @@ const inputStyles = {
2726

2827
class GridImagePicker extends React.Component<GridPickerProps> {
2928
static defaultProps = {
30-
as: 'ul',
3129
gridColumns: 5,
3230
inputIcon: 'search',
3331
inputPlaceholder: 'Search...',
@@ -41,7 +39,7 @@ class GridImagePicker extends React.Component<GridPickerProps> {
4139
}
4240

4341
render() {
44-
const { as: ElementType, gridColumns, inputIcon, inputPlaceholder } = this.props
42+
const { gridColumns, inputIcon, inputPlaceholder } = this.props
4543

4644
return (
4745
<>
@@ -53,7 +51,7 @@ class GridImagePicker extends React.Component<GridPickerProps> {
5351
inputRef={this.setInputNode}
5452
/>
5553
<Grid
56-
as={ElementType}
54+
as="ul"
5755
accessibility={gridBehavior}
5856
columns={gridColumns}
5957
style={gridStyles}

docs/src/prototypes/popups/GridImagePicker/GridImagePickerItem.tsx

+3-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Image, Button } from '@stardust-ui/react'
33
import * as React from 'react'
44

55
export interface GridPickerItemProps {
6-
as?: keyof React.ReactHTML
76
title?: string
87
imageSrc: string
98
onClick?: (e: React.SyntheticEvent, props: GridPickerItemProps) => void
@@ -17,19 +16,15 @@ const imageButtonStyles = {
1716
}
1817

1918
class GridImagePickerItem extends React.Component<GridPickerItemProps> {
20-
static defaultProps = {
21-
as: 'li',
22-
}
23-
2419
render() {
25-
const { title, imageSrc, as: ElementType, onClick } = this.props
20+
const { title, imageSrc, onClick } = this.props
2621

2722
return (
28-
<ElementType>
23+
<li>
2924
<Button styles={imageButtonStyles} onClick={onClick} title={title} role="listitem">
3025
{imageSrc && <Image src={imageSrc} fluid />}
3126
</Button>
32-
</ElementType>
27+
</li>
3328
)
3429
}
3530
}

0 commit comments

Comments
 (0)