ESLint error “expected to return a value at the end of arrow function”

This function works as expected in react but i get the same ESLint error mentioned in the title. Ive checked similar questions and the format below looks to match those answer but im still getting the same error.

const getDogFields = () => {
        const dogArray = [
            {
                title: 'breed',
                value: name,
            },
        ];
    
        let newDogArray;
    
        if (!editInput?.editDogForm && dogValue?.value === 'lab') {
            newDogArray = [
                ...dogArray,
                {
                    title: 'Who walks the dog?',
                    value: whoWalksDogValue,
                },
                {
                    title: 'How old is the dog?',
                    value: dogWalkValue,
                },
            ];
        } else {
            newDogArray = [...dogArray];
        }
    
        return newDogArray;  
    };