のパラメータに割り当てられない私には、以下の式があります。活字体:型の引数は、「RegExpMatchArray」タイプ「文字列」
import { persistState } from 'redux-devtools';
const enhancer = compose(
applyMiddleware(thunk, router, logger),
DevTools.instrument(),
persistState(
window.location.href.match(/[?&]debug_session=([^&]+)\b/)
)
);
を私は次のエラー
と機能に一致するように、引数にswiggly取得'RegExpMatchArray'型の引数は、 型 'string'のパラメータに割り当てられません。文字列を正規表現で照合し、その検索結果を含む配列 を返します。 (方法) String.match(正規表現:正規表現):RegExpMatchArray(+1オーバーロード)
VSCodeにおけるPEEK定義が示す:私はそれを見るよう
match(regexp: string): RegExpMatchArray;
/**
* Matches a string with a regular expression, and returns an array containing the results of that search.
* @param regexp A regular expression object that contains the regular expression pattern and applicable flags.
*/
match(regexp: RegExp): RegExpMatchArray;
/**
* Replaces text in a string, using a regular expression or search string.
* @param searchValue A string that represents the regular expression.
* @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
*/
、引数の型は正規表現であります定義内のパラメータも同様です。それではなぜエラー?
あなたは試合の結果をどうしていますか? –
[MCVE](http://stackoverflow.com/help/mcve)を入力してください。 –