Miron Machnicki
1 min readApr 10, 2019

--

Yes. Because you have passed method directly into map, “this” of that method is pointing to different scope.

So you can change renderItem to be arrow function or

<div>
{ items.map(item => this.renderItem(item)) }
</div>

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Miron Machnicki
Miron Machnicki

Written by Miron Machnicki

Full-stack developer - react.js, node.js, serverless. @machnicki

No responses yet

Write a response