Skip to content

Error while updating property 'accessibilityLabel' of a view managed by : RNCMaskedView #249

@XChikuX

Description

@XChikuX

Environment

Expo SDK 55, latest masked-view

Description

accessibilityLabel={children} on MaskedView occasionally causes error updating accessibilityLabel issue.

Debug Logs:

Caused by: java.lang.ClassCastException: com.facebook.react.bridge.ReadableNativeArray cannot be cast to java.lang.String
at com.facebook.react.uimanager.ViewManagersPropertyCache$StringPropSetter.getValueOrDefault(ViewManagerPropertyCache.java:291)
at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateViewProp(ViewManagersPropertyCache.java:86)

Reproducible Demo

        <MaskedView
            accessibilityLabel={children}
            accessibilityRole="text"
            maskElement={
                <Text style={style} testID={testID} onLayout={onTextLayout} {...props}>
                    {children}
                </Text>
            }>
            <LinearGradient
                colors={selectedGradient.value as unknown as readonly [string, string, ...string[]]}
                start={{ x: 0, y: 0 }}
                end={{ x: 1, y: 0 }}
                style={{ flexDirection: 'row' }}>
                {/* Invisible placeholder to size the gradient */}
                <Text style={[style, { opacity: 0 }]} {...props}>
                    {children}
                </Text>

                {/* Glimmer / shimmer overlay — rendered unconditionally;
                    the animation starts via useAnimatedReaction. */}
                {selectedGradient.glimmer && animationType === 'gradient' && (
                    <Animated.View
                        style={[
                            {
                                position: 'absolute',
                                top: -10,
                                bottom: -10,
                                backgroundColor: selectedGradient.glimmer,
                            },
                            glimmerViewStyle,
                        ]}
                    />
                )}
            </LinearGradient>
        </MaskedView>

Here's a video of what happens:

MaskedView_w_accessibilityLabel.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions