2

I get that error when I want to display my nav from react-sidenav: Error stack-trace: https://hastebin.com/isiguweces.php

My class Navig.js whose contains my nav: https://hastebin.com/kanotegido.xml

And my App.js where it's use : https://hastebin.com/xiyikatice.scala

Tryliom
  • 111
  • 1
  • 17
  • the problem is that the `props$icon` is `undefined`. Have you tried to `console.log` it and see if is there some data? – reisdev Jun 11 '18 at 12:04
  • Yep, the icon was named user instead of userCircle, that is fixed but now I have an issue with history [here](https://hastebin.com/ameveremek.coffeescript) – Tryliom Jun 11 '18 at 12:25
  • are you using `history` in your router? Can I see the code? – reisdev Jun 11 '18 at 12:29
  • I try to use it but it send me more error all the time: [App.js](https://hastebin.com/kuzelafena.js), [Navig.js](https://hastebin.com/ijogidulof.xml) – Tryliom Jun 11 '18 at 12:31
  • remove the line `this.props.history.push('/');`. It's not necessary, because you have the route `'/'` as exact path. That's probably what's giving the error. And, the `history` is not a `prop` of your component `App` – reisdev Jun 11 '18 at 12:33
  • Nope I get [that](https://hastebin.com/ucilowayiv.bash) if I remove the line – Tryliom Jun 11 '18 at 12:35
  • Try `this.props.history = history` – reisdev Jun 11 '18 at 12:37
  • It works if I import SideNav instead of generate one with `const SideNav = withRR4();` , thank you – Tryliom Jun 11 '18 at 12:41

1 Answers1

3

The problem is that the props$icon is undefined (named user instead of userCircle).

Change

import { user } from 'react-icons-kit/fa/userCircle';

to

import { userCircle } from 'react-icons-kit/fa/userCircle';

To fix your issue.

reisdev
  • 3,215
  • 2
  • 17
  • 38