# React - 12. Updating the state -\[SOLVED\] enscapsulation not working

**URL:** <https://forum.codewithmosh.com/t/react-12-updating-the-state-solved-enscapsulation-not-working/2619>\
**Category:** React\
**Created:** [February 12, 2021, 1:54am UTC](https://forum.codewithmosh.com/t/react-12-updating-the-state-solved-enscapsulation-not-working/2619 "2021-02-12T01:54:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![giorgos](https://avatars.discourse-cdn.com/v4/letter/g/cc9497/32.png) [@giorgos](https://forum.codewithmosh.com/u/giorgos)\
**Post date:** [February 12, 2021, 1:54am UTC](https://forum.codewithmosh.com/t/react-12-updating-the-state-solved-enscapsulation-not-working/2619/1 "2021-02-12T01:54:31Z")

</div>

When I set counterN = {counter} in order to enscapsulate (inside counters.jsx)  
and then set this.props.counterN.value and this.props.counterN.id (inside counter.jsx)  
I get the error  
"index.js:1 Warning: Received NaN for the `children` attribute.  
If this is expected, cast the value to a string. "

Can you please JUST confirm if it’s just me  
or the code Mosh teach us is now obsolete? - I use the newest React -  
Thanks in advance

[SOLVED] The problem was that I had set counterN={counter}  
this.props.counterN.value and this.props.counterN.id (inside counter.jsx)

supposing that counterN in counterN = {counter} was a variable
