I just want to be able to "Modify" the 'content' variable from inside the callback function.
class MyClass extends React.Component {
render() {
var content = 'initial value';
const token = this.props.match.params.token;
Meteor.call('checkResetToken', token, (error, result) => {
console.log('content: ', content); // prints 'initial value'
if (result) {
content = 'true result';
} else {
content = 'false result';
}
console.log('content inside the callback: ', content); // 'false result'
});
return 'content: ' + content; // prints 'initial value'
}
}
It sounds like the callback takes a local copy of the content variable, but how can I change the variable ITSELF.
Any help would be highly appreciated