Проблема
Type 'string | string[] | null' is not assignable to type 'string | null'.
Type 'string[]' is not assignable to type 'string'. TS2322
Есть код:
const params = queryString.parse(history.location.search);
let initFilterValue: string | null = null;
if ((typeof params[filterParamName] === 'string')) {
initFilterValue = params[filterParamName]; // ошибка
}
При этом типы для queryString.parse() определены так: