weareinreach / InReach

Avoid .bind() or local functions in JSX properties JS-0417
Performance
Major
5 occurrences in this check
JSX props should not use arrow functions
355const PrintBody = forwardRef<HTMLButtonElement, PolyButtonProps>((props, ref) => {
356	/** Strip out unused props to prevent react errors */
357	const { organizationId: _org, serviceId: _serv, isMenu: _isMenu, ...restProps } = props
358	return <Box component='button' ref={ref} onClick={() => window.print()} {...restProps} />359})
360
361PrintBody.displayName = 'Print'
JSX props should not use arrow functions
340		copiedToClipboard()
341	}
342
343	return <Box component='button' ref={ref} onClick={handleCopy} {...restProps} />344})
345
346CopyToClipBoard.displayName = 'CopyToClipboard'
JSX props should not use arrow functions
298					<Button
299						className={isMenu ? classes.icon : classes.button}
300						radius='md'
301						onClick={() => removeItem.mutate({ id: singleListId, organizationId, serviceId })}302					>
303						{ButtonInner}
304					</Button>
JSX props should not use arrow functions
207			onError: () => {
208				if (isSaved) return
209				setMenuChildren(
210					<Menu.Item onClick={() => savedLists.refetch()} closeMenuOnClick={false}>211						<Center>{t('retry')}</Center>
212					</Menu.Item>
213				)
JSX props should not use arrow functions
157		}
158	}
159
160	return <Menu.Item onClick={() => clickHandler()}>{name}</Menu.Item>161}
162
163export const SaveToggleButton = forwardRef<HTMLDivElement, SaveToggleButtonProps>(