Chore: Fix more TypeScript errors (#36918)

* TypeScript: Fix some strict typescript errors

* Fix more strict typescript errors

* Few more fixes

* Better string conversion

* update check script to 195
This commit is contained in:
Ashley Harrison
2021-07-20 09:57:03 +01:00
committed by GitHub
parent ea375db8b2
commit 220b964de5
26 changed files with 50 additions and 51 deletions

View File

@@ -22,7 +22,7 @@ export interface Props<T> extends HTMLAttributes<HTMLButtonElement> {
* @internal
* A temporary component until we have a proper dropdown component
*/
export const ButtonSelect = React.memo(<T,>(props: Props<T>) => {
const ButtonSelectComponent = <T,>(props: Props<T>) => {
const { className, options, value, onChange, narrow, variant, ...restProps } = props;
const [isOpen, setIsOpen] = useState<boolean>(false);
const styles = useStyles2(getStyles);
@@ -73,9 +73,11 @@ export const ButtonSelect = React.memo(<T,>(props: Props<T>) => {
)}
</ButtonGroup>
);
});
};
ButtonSelect.displayName = 'ButtonSelect';
ButtonSelectComponent.displayName = 'ButtonSelect';
export const ButtonSelect = React.memo(ButtonSelectComponent) as typeof ButtonSelectComponent;
const getStyles = (theme: GrafanaTheme2) => {
return {

View File

@@ -10,7 +10,7 @@ import { ColorSwatch } from '../ColorPicker/ColorSwatch';
* */
export interface ColorValueEditorProps {
value?: string;
onChange: (value?: string) => void;
onChange: (value: string) => void;
}
/**