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.

TypeError: this.props.t is not a function

See original GitHub issue

We have a web app bootstrapped with create-react-app and are using react-i18next to manage translations. We are constantly seeing errors about t function being undefined. This is being reported many times per day by our error tracking system and it occurs only on Android devices.

We have not been able to reproduce it by ourselves, but it happens to users with Android phones all the time.

Example error:

TypeError: this.props.t is not a function
File "containers/ReviewContainer.js" line 106 col 34 in t.value
<Header1>{this.props.t('review.title')}</Header1>

We have done lots of investigation around this issue, but haven’t found any solutions. t function is used in a very standard way through translate HOC and we have tried to initialize i18next differently etc, but these errors still keep occurring.

What could be going on? If you need more information, I’m happy to provide it. Our last chance would be to switch to a different internationalization library completely, but I’m a bit hesitant to do that.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mpkcj93commented, Feb 10, 2021

Be sure that you import the default classes without the graph parentheses.

1reaction
jamuhlcommented, Oct 25, 2018

closing this for now…still no clue…can’t reproduce. sorry for that…a PR or more information for reproduction would be very welcome

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReactJS with ES6: this.props is not a function when I ...
This returns Uncaught TypeError: this.props.filterUser is not a function . Any idea? Binding maybe? [EDIT] Solution (Thanks @knowbody & @Felipe ...
Read more >
'X' is not a function TypeError in React [Solved] | bobbyhadz
The React.js Uncaught TypeError: X is not a function occurs when we try to call a value that is not a function as...
Read more >
This.props is not a function. Passing methods as props?
Yes, the prop is meant to act as a function. It was defined as a method in the parent component. Aside from binding...
Read more >
TypeError: this.props.onIncrement is not a function - React
I keep getting this error. I tried to figure it out, but I stuck( Please help!
Read more >
Passing Functions to Components - React
handleClick}> passes this.handleClick so you want to bind it. However, it is unnecessary to bind the render method or the lifecycle methods: we...
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