我正在使用REDX,react-router和Material-ui來製作我的應用程序。我有一個問題來顯示訂單的細節。當用戶點擊一個平面按鈕時,我想讓這個按鈕發送給用戶一個新的url。我試圖做到這一點,但它不起作用。如何使用平面圖標作爲鏈接來改變路由與反應路由器
import React, { Component, PropTypes } from 'react';
import { browserHistory } from 'react-router'
import FlatButton from 'material-ui/FlatButton';
const myButton = (props)=(
<FlatButton label="See details" onClick={()=>(browserHistory.push('/order/1'))}/>
)
export default myButton;
您可以擴展「它不工作」?如果您檢查控制檯,您是否收到任何錯誤? –
@PaulS我的意思是它不會去我想要的路線。它什麼也沒做,控制檯也沒有顯示任何信息,但是我放了一條消息來確認道具 – Golinmarq