birkir / react-native-carplay

CarPlay with React Native
https://birkir.dev/react-native-carplay/
MIT License
655 stars 108 forks source link

The app crashes when an empty section is passed to the ListTemplate. #157

Open shubhadeep-foodhub opened 10 months ago

shubhadeep-foodhub commented 10 months ago
const template = new ListTemplate({
            sections: [],
            title: 'Test Android Auto',
            emptyViewSubtitleVariants: ["No data found"],
            async onItemSelect(e) {
                console.log("test clicked", e);
            },
        });
        CarPlay.setRootTemplate(template);

When testing the ListTemplate, if the sections is empty the the app crashed.

To Reproduce Steps to reproduce the behaviour:

  1. create a list template and provide an empty array in the sections

Expected behaviour Should show emptyViewSubtitleVariants

Android Auto (please complete the following information):