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

TypeError: Cannot read property 'type' of null ( ListDivider2.default) #40

Open
eromoe opened this issue Aug 18, 2017 · 2 comments
Open
Assignees

Comments

@eromoe
Copy link

eromoe commented Aug 18, 2017

Hi, I want to make table by List, code as below

<List className="corpus-list">
    <ListItem >
      <Cell col={4}>name</Cell>
      <Cell col={4}>desc</Cell>
      <Cell col={4}>action</Cell>
    </ListItem>
    <ListDivider/>
    {
      corpusList && corpusList.map((c)=> [
        <ListItem key={c.name}>
          <Cell col={4}>{c.name}</Cell>
          <Cell col={4}>{c.desc}</Cell>
          <Cell col={4}> <Link to={corpusLink(c.id)} ><Icon name="keyboard_arrow_right"></Icon></Link> </Cell>
        </ListItem>,
        <ListDivider/>,
      ])
    }
</List>

got error:

Uncaught (in promise) TypeError: Cannot read property 'type' of null
    at eval (List.js:42)
    at mapSingleChildIntoContext (ReactChildren.js:107)
    at traverseAllChildrenImpl (traverseAllChildren.js:77)
    at traverseAllChildrenImpl (traverseAllChildren.js:93)
    at traverseAllChildren (traverseAllChildren.js:172)
    at mapIntoWithKeyPrefixInternal (ReactChildren.js:127)
    at Object.mapChildren [as map] (ReactChildren.js:149)
    at List (List.js:41)
    at eval (ReactCompositeComponent.js:306)
    at measureLifeCyclePerf (ReactCompositeComponent.js:75)

image

But it is fine with :

<List className="corpus-list">
    {
      corpusList && corpusList.map((c)=> [
        <ListItem key={c.name}>
          <Cell col={4}>{c.name}</Cell>
          <Cell col={4}>{c.desc}</Cell>
          <Cell col={4}> <Link to={corpusLink(c.id)} ><Icon name="keyboard_arrow_right"></Icon></Link> </Cell>
        </ListItem>,
        <ListDivider/>,
      ])
    }
</List>
@kradio3 kradio3 self-assigned this Aug 18, 2017
@kradio3
Copy link
Owner

kradio3 commented Aug 18, 2017

Works for me on Codepen :)
Looks that problem with Link. Be sure you import it from react-router-dom, not from react-router

@eromoe
Copy link
Author

eromoe commented Aug 19, 2017

But I am using a boilerplate which base on react-router 3.0.0 , not compatible with react-router-dom

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

2 participants