Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example is giving an error : Cannot destructure undefined #72

Open
rikinshah23 opened this issue Apr 19, 2020 · 0 comments
Open

Example is giving an error : Cannot destructure undefined #72

rikinshah23 opened this issue Apr 19, 2020 · 0 comments

Comments

@rikinshah23
Copy link

rikinshah23 commented Apr 19, 2020

Hello All,
I am trying sample code in rn version "0.61.5" with react hooks.

import React, { useState, useEffect } from "react";
import { FlatList, View, StyleSheet } from "react-native";
import firestore from "@react-native-firebase/firestore";
import { useSelector, shallowEqual, useDispatch } from "react-redux";
import { theme, deviceWidth, deviceHeight } from "../../utils/theme";
import {
  emailValidator,
  passwordValidator,
  firstNameValidator,
  lastNameValidator,
} from "../../utils/utils";
import styles from "../../utils/styles";
import {
  Surface,
  Text,
  TextInput,
  ActivityIndicator,
  Button,
} from "react-native-paper";
var AlphabetListView = require('react-native-alphabetlistview');

const contacts = {
  'A': [{ name: 'A1' }, { name: 'A2' }, { name: 'A3' }],
  "E": [{ name: 'E1' }, { name: 'E2' }, { name: 'E3' }, { name: 'E4' }],
  'F': [{ name: 'F1' }, { name: 'F2' }, { name: 'F3' }],
  'H': [{ name: 'H1' }, { name: 'H2' }, { name: 'H3' }, { name: 'H5' }],
  'J': [{ name: 'J1' }, { name: 'J2' }, { name: 'J3' }, { name: 'J5' }],
  'K': [{ name: 'K1' }, { name: 'K2' }, { name: 'K3' }, { name: 'K5' }],
  'N': [{ name: 'N1' }, { name: 'N2' }, { name: 'N3' }, { name: 'N5' }],
  'Y': [{ name: 'Y1' }, { name: 'Y2' }, { name: 'Y3' }, { name: 'Y5' }, { name: 'Y6' }],
}

export default function OfficeScreen() {
  const [images, setImages] = useState([]);

   function Cell() {

    return (
      <View>
        <Text>S</Text>
      </View>
    )
  }
  return (
    <AlphabetListView
    data={contacts }
    cell={Cell()}
    cellHeight={100}
    sectionHeaderHeight={22.5}
  />
  );
}

I am getting below error :

image

Could anyone pls help me running this basic example? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant