خرید بک لینک

Vote count: 0

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()?

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 14 خرداد 1395 ساعت: 12:49

صفحه بندی