C
C
ch-aqwer2018-02-20 19:11:16
React
ch-aqwer, 2018-02-20 19:11:16

Why write .toString() when migrating to react 16?

Good afternoon! Who knows what gives in this .toString()and what it is for?
Without this, the console does not give any errors.

<span className={b('text').toString()}>{props.value}</span>

This code was written when switching to react 16
in react 15 so Thank you!
<span className={b('text')}>{props.value}</span>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Coffee Trip, 2018-02-20
@ch-aqwer

Well, from the logical options, I think that for the reliability of the value returned by the b () function;
If it comes to that, in order to at least understand something, it was necessary to show the function itself, what was eventually rendered, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question