question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Accordion throws errors.

See original GitHub issue
import React, { Component } from "react";
import { Container, Header, Content, Accordion } from "native-base";

const dataArray = [
    { title: "First Element", content: "Lorem ipsum dolor sit amet" },
    { title: "Second Element", content: "Lorem ipsum dolor sit amet" },
    { title: "Third Element", content: "Lorem ipsum dolor sit amet" }
];
export default class AccordionExample extends Component {
    render() {
        return (
            <Container>
                <Header />
                <Content padder>
                   <Accordion dataArray={dataArray} expanded={0}/>
                </Content>
            </Container>
        );
    }
}

this is the code that i m running…i have copied this code from https://docs.nativebase.io/Components.html#accordion-def-headref… when i ran this code it throws following error. capture

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
akhil-gacommented, Jun 25, 2018

@nainishmodi

Sample code

import React, { Component } from "react";
import { Container, Header, Content, Accordion, Card, CardItem, Body, Text } from "native-base";
const dataArray = [
  { title: 1, content: ["Item one", "Item two", "Item three", "Item four"] },
  { title: 2, content: ["Item five", "Item six", "Item seven", "Item eight"] },
  { title: 3, content: ["Item nine", "Item ten", "Item eleven", "Item twelve"] }
];
export default class AccordionExample extends Component {
  render() {
    return (
      <Container>
        <Header />
        <Content padder>
          <Accordion dataArray={dataArray} renderHeader={(title) => <Card>
            <CardItem style={{ backgroundColor: "green" }}>
              <Body>
                <Text>
                  {title}
                </Text>
              </Body>
            </CardItem>
          </Card>}
            renderContent={(content) => {
              let cards = content.map((item, index) => {
                return <Card key={index}>
                  <CardItem style={{ backgroundColor: "lightgreen" }}>
                    <Body>
                      <Text>
                        {item}
                      </Text>
                    </Body>
                  </CardItem>
                </Card>
              })
              return cards
            }} />
        </Content>
      </Container>
    );
  }
}
2reactions
SupriyaKalghatgicommented, Jun 25, 2018

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Accordion] Accordion throws JavaScript error on opening
Description: I'm using the minified version of Foundation 6.0.5. When I click an Accordion panel it opens but the following error is thrown...
Read more >
React Bootstrap Accordion Error: Element type is invalid
React Bootstrap Accordion Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components).
Read more >
Accordion issues with v18.3.0.50 | Blazor Forums - Syncfusion
Forum Thread - Accordion issues with v18.3.0.50 - Blazor. ... The Accordion control throws errors when expanding an item. Regards,.
Read more >
The React demo for Accordion throws the "W1019" error and ...
The Accordion items cannot be expanded and the W1019 error will occur on any attempt to expand an item. Expected results. The demo...
Read more >
Accordion with single item throws JS error in ... - Sencha
No information is available for this page.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found