2016-11-16 18 views
-2

用戶選中複選框後,我將重定向到其他頁面。 我是新來的react-redux。現在,我所知道的是通過調度處理提交 按鈕,但我想知道如何處理 複選框操作?如何處理reactx中的複選框事件?

export default class myReportForm extends BaseForm { 


      return(


        </form> 
       </div>   
     ); 

     } 
    } 

    Through handleSubmit in form, I could able to handle submit action. Can any one tell me how to handle checkbox . For example, when I ever click on Afloat , It should redirect me to another page or atleast some action should happen. 
+0

@ZackTanner標記爲不具有建設性。 – lux

+0

@lux爲什麼?也許用戶不知道這個回購的自述提供了一個視頻解釋它的工作原理。也許OP不知道這是連接兩者的獨立庫。 –

+0

@ZackTanner剛剛提供的內容對於一個掙扎的用戶來說遠比粘貼一個鏈接更有用。 – lux

回答

3

mapStateToPropsmapDispatchToActions是輔助功能將在你的芯線達到了Redux商店。 mapStateToProps將組件的屬性鏈接到狀態並mapDispatchToActions將其事件鏈接到可以分派的操作。

http://redux.js.org/docs/basics/UsageWithReact.html#container-components

與以往一樣(!我一直推薦這一點)來看看:

https://egghead.io/lessons/javascript-redux-generating-containers-with-connect-from-react-redux-visibletodolist(整個過程和它的後續 - Idiomtic終極版 - 是偉大的)。