I have the following component:
const Rec = React.createClass({
renderText() {
if (hidden) {
req_link = <Link to={`/rec/edit`} style={st}>Request link</Link>
}
else {
request_link = null
}
retu (
<div> {request_link} </div>
);
},
fields() {
....
if (fieldID == "hidden") {
var hidden = true;
} else {
var hidden = false;
}
retu (
<div> other stuff.... </div>
);
},
});
renderText() should show a link if the value of hidden is true, and value for this variable can only be set in fields(). So how can I pass hidden from fields() to renderText()?
