meliorence / react-native-render-html

iOS/Android pure javascript react-native component that renders your HTML into 100% native views
https://meliorence.github.io/react-native-render-html/
BSD 2-Clause "Simplified" License
3.48k stars 589 forks source link

Android TypeError Cannot read property 'html' of undefined #553

Closed putuoka closed 2 years ago

putuoka commented 2 years ago

Decision Table

Good Faith Declaration

Description

Can't produce the bugs because randomly appear on different android real device. This error log captured from sentry causing force close to the Apps in user side. This error message from device android Redmi K20 Pro. Other android device seem working fine.

React Native Information

"react-native": "0.63.4",

RNRH Version

"react-native-render-html": "^6.3.1",

Tested Platforms

Reproduction Platforms

Minimal, Reproducible Example

Here the code part:

< KeyboardAvoidingView > ...

`<View style={[apply('flex mb-5')]}>

                                <View style={apply('mt-1')}>
                                    <HTML
                                        source={{`<View style={[apply('flex mb-5')]}>

                                <View style={apply('mt-1')}>
                                    <HTML
                                        source={{
                                            html:
                                                props.loginContent?.data?.middle_content.html ??
                                                '<div></div>',
                                        }}
                                        containerStyle={apply('flex')}
                                        renderersProps={renderersProps}
                                        systemFonts={systemFonts}
                                        contentWidth={width}
                                        tagsStyles={tagsStyles}
                                    />
                                </View>
                                <Text
                                    onPress={() =>
                                        props.navigation.navigate('WebView', {
                                            link: props.loginContent?.data?.footer_content.url,
                                        })
                                    }
                                    style={[styles.text, apply('text-orange underline mt-6')]}>
                                    {props.loginContent?.data?.footer_content.title}
                                </Text>
                            </View>`
                                            html:
                                                props.loginContent?.data?.middle_content.html ??
                                                '<div></div>',
                                        }}
                                        containerStyle={apply('flex')}
                                        renderersProps={renderersProps}
                                        systemFonts={systemFonts}
                                        contentWidth={width}
                                        tagsStyles={tagsStyles}
                                    />
                                </View>
                                <Text
                                    onPress={() =>
                                        props.navigation.navigate('WebView', {
                                            link: props.loginContent?.data?.footer_content.url,
                                        })
                                    }
                                    style={[styles.text, apply('text-orange underline mt-6')]}>
                                    {props.loginContent?.data?.footer_content.title}
                                </Text>
                            </View>`

...

< /KeyboardAvoidingView>

Additional Notes

No response

jsamr commented 2 years ago

Hi @putuoka and thank you for your contribution! Your code snippet is unfortunately not in a reproducible state, and my availability to investigate issues this month is very limited. To help me help you, would you mind sharing an expo snack which reproduces the issue you encountered? That would vastly enhance the odds this issue is tackled soon.