TypeError: funcsMap[propKey] is not a function when using createText()
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- react-native, typescript
調査の方向性
Start by reproducing the supplied TypeScript example with createText(), Title, and the v2.0.0-to-v2.1.0 upgrade, then compare the behavior between those versions. The issue is done when Title renders with its Restyle props in v2.1.0 without the funcsMap TypeError, while the existing plain Text behavior remains unaffected.
索引モデルが issue の本文から書いたものです。
説明
The code below works as expected with v2.0.0 of Restyle, but when I upgrade to v2.1.0 I get the following error.
TypeError: funcsMap[propKey] is not a function. (In 'funcsMap[propKey](props, {
theme: theme,
dimensions: dimensions
})', 'funcsMap[propKey]' is undefined)
After some digging through my code, it appears that if I remove my <Title> component, this error goes away. So there's some issue with createText() perhaps?
I looked through the changelog for 2.0.0 → 2.1.0 but don't see anything obvious? If I replace my <Title> component with a plain <Text> component, it also works (but of course I lose the Restyle features).
import { createBox, createText } from '@shopify/restyle';
import React, {
forwardRef,
useImperativeHandle,
useRef,
useState,
} from 'react';
import { TouchableWithoutFeedback } from 'react-native';
import { Theme } from '~/theme/index';
import TextInput from './TextInput';
const InputWrapper = createBox<Theme>();
const OuterWrapper = createBox<Theme>();
const OutlineView = createBox<Theme>();
const Wrapper = createBox<Theme>();
const Title = createText<Theme>();
const SignInTextInput = (
{
title,
...rest
}: {
onChangeText: () => void;
title: string;
value: string;
},
ref: React.Ref<any>,
) => {
const [isFocused, setIsFocused] = useState(false);
const inputRef = useRef<any>();
const focusInput = () => {
inputRef.current?.focus();
};
useImperativeHandle(ref, () => ({
focus: () => {
focusInput();
},
}));
return (
<TouchableWithoutFeedback onPress={focusInput}>
<OuterWrapper>
<OutlineView
backgroundColor={
isFocused ? 'cardPrimaryBackground' : 'mainBackground'
}
bottom={-2}
left={-2}
position="absolute"
right={-2}
style={{
borderRadius: 10,
}}
top={-2}
/>
<Wrapper
backgroundColor="mainBackground"
borderColor="cardPrimaryBackground"
borderWidth={1}
padding="s"
style={{
borderRadius: 7.5,
}}
>
<Title color="cardPrimaryBackground" fontSize={12}>
{title}
</Title>
<InputWrapper flexDirection="row">
<TextInput
{...rest}
onBlur={() => setIsFocused(false)}
onFocus={() => setIsFocused(true)}
ref={inputRef}
/>
</InputWrapper>
</Wrapper>
</OuterWrapper>
</TouchableWithoutFeedback>
);
};
export default forwardRef(SignInTextInput);
- 主要言語
- TypeScript
- スター
- 3.4k
- フォーク
- 154
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Shopify/restyle のほかの issue
-
Reanimated 4.4.x animated components conflict with Restyle theme対応中かも @KAMRONBEK が 131 日前に担当しました。 オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 15/100
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
Shopify/restyle の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
testing-library/jest-dom#749 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
zed-industries/delta-claude#50 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
CDLUC3/dmptool-doc#660 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
stripe/stripe-terminal-react-native#1162 ·
メンテナーはふだん 1 日以内に返信