Skip to content

Commit

Permalink
fix: handle implicit any
Browse files Browse the repository at this point in the history
  • Loading branch information
IanKrieger committed Jul 21, 2023
1 parent 7960240 commit e61f062
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/form/FormikHelpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const FormikSwitch: React.FC<FormikSwitchProps> = (props) => {
<>
<FormControlLabel control={<Switch {...field} />} label={props.label} />
<ErrorMessage name={field.name}>
{(msg) => <FormHelperText error>{msg}</FormHelperText>}
{(msg: string) => <FormHelperText error>{msg}</FormHelperText>}
</ErrorMessage>
</>
);
Expand All @@ -89,7 +89,7 @@ export const FormikRadioGroup: React.FC<
<>
<RadioGroup {...props} {...field} />
<ErrorMessage name={field.name}>
{(msg) => <FormHelperText error>{msg}</FormHelperText>}
{(msg: string) => <FormHelperText error>{msg}</FormHelperText>}
</ErrorMessage>
</>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FieldArray, useFormikContext } from "formik";
import { FieldArray, FieldArrayRenderProps, useFormikContext } from "formik";
import {
Box,
Button,
Expand All @@ -23,7 +23,7 @@ export function NewAdSet(props: { isEdit: boolean }) {
return (
<>
<FieldArray name="adSets">
{({ remove, push }) => (
{(helper: FieldArrayRenderProps) => (
<Stack spacing={0.5}>
{values.adSets.map((adSet, idx) => (
<Stack direction="row" justifyContent="space-between">
Expand Down Expand Up @@ -54,7 +54,7 @@ export function NewAdSet(props: { isEdit: boolean }) {
const newIdx = idx - 1;
selected.current = newIdx;
history.replace(`?current=${newIdx}`);
remove(idx);
helper.remove(idx);
}}
>
<RemoveCircleOutlineIcon fontSize="small" color="error" />
Expand All @@ -69,7 +69,7 @@ export function NewAdSet(props: { isEdit: boolean }) {
pb={0}
pt={0}
component={Button}
onClick={() => push(initialAdSet)}
onClick={() => helper.push(initialAdSet)}
border="1px solid #ededed"
>
<Typography variant="overline" color="primary">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Link, Stack, Typography } from "@mui/material";
import { ConversionFields } from "components/Conversion/ConversionFields";
import React from "react";
import { FieldArray, useField } from "formik";
import { FieldArray, FieldArrayRenderProps, useField } from "formik";
import { Conversion, initialConversion } from "../../../../../types";
import { CardContainer } from "components/Card/CardContainer";

Expand All @@ -16,7 +16,7 @@ export function ConversionField({ index }: Props) {
return (
<CardContainer header="Conversion">
<FieldArray name={`adSets.${index}.conversions`}>
{({ remove, push }) => (
{(helper: FieldArrayRenderProps) => (
<>
<Stack direction="row" spacing={1}>
<Typography variant="body2" sx={{ mb: 2 }}>
Expand All @@ -26,7 +26,7 @@ export function ConversionField({ index }: Props) {
<Link
underline="none"
variant="body2"
onClick={() => push(initialConversion)}
onClick={() => helper.push(initialConversion)}
sx={{ cursor: "pointer" }}
>
Add Conversion Tracking +
Expand All @@ -36,7 +36,7 @@ export function ConversionField({ index }: Props) {
<Link
underline="none"
variant="body2"
onClick={() => remove(0)}
onClick={() => helper.remove(0)}
sx={{ cursor: "pointer" }}
>
Remove Conversion Tracking -
Expand Down

0 comments on commit e61f062

Please sign in to comment.