weareinreach / InReach

Avoid .bind() or local functions in JSX properties JS-0417
Performance
Major
11 days agoa year old
JSX props should not use arrow functions
 86						<PhoneEmailFlags role={role} />
 87					</Stack>
 88				</PhoneEmailFormProvider>
 89				<Button onClick={handleSubmit}>Save</Button> 90			</Modal>
 91			<Box component='button' ref={ref} onClick={handler.open} {...props} />
 92		</>
JSX props should not use arrow functions
 9		return (
10			<div ref={ref} {...props}>
11				<Group
12					sx={(theme) => ({13						alignItems: 'center',14						gap: theme.spacing.xs,15						padding: theme.spacing.xs,16						borderRadius: theme.radius.sm,17						// backgroundColor: theme.colors.gray[0],18						cursor: 'pointer',19						'&:hover': {20							backgroundColor: theme.other.colors.primary.lightGray,21						},22					})}23				>
24					{icon && isValidIcon(icon) && <Icon icon={icon} width={18} />}
25					{icon && !isValidIcon(icon) && <Text>{icon}</Text>}
JSX props should not use arrow functions
60							{...form.getInputProps('title')}
61						/>
62						<Textarea
63							sx={(theme) => ({64								'& .mantine-Textarea-required': { color: theme.other.colors.secondary.black },65							})}66							withAsterisk
67							label={t('message_text')}
68							placeholder={t('alert-message-instructions') as string}
JSX props should not use arrow functions
49						<Title ta='center' order={2}>
50							{t('alert-message')}
51						</Title>
52						<Text ta='center' color='black' sx={(theme) => theme.other.utilityFonts.utility4}>53							{`${t('organization')}: ${orgName}`}
54						</Text>
55					</Stack>
JSX props should not use arrow functions
246					</Stack>
247				</UserSurveyFormProvider>
248			</Modal>
249			<Box component='button' ref={ref} onClick={() => handler.open()} {...props} />250		</>
251	)
252})