ReactJS - 如何查找paymentId的值并作为回报呈现其值

时间:2018-06-09 13:10:02

标签: javascript reactjs react-native react-router

PaymentId应该有一个值,它应该包含在链接标记中以生成正确的链接

export default class MkPayment extends React.Component {
  constructor(props) {
    super(props);

    const query = queryString.parse(window.location.search);
    this.state = {
      paymentId: query.id,
      payeeName: "",
    },
  };
  render() {
    return (
      <Link className="border-button ml10" to={{ search: "?id=" + this.state.paymentId + "&retry=true" }}>Retry Payment</Link>
      <p>{this.state.payeeName}</p>
    );
  }
}

0 个答案:

没有答案