React input checkbox select all component

后端 未结 3 1827
野的像风
野的像风 2021-01-02 16:19

I\'m trying to build a proper react input checkbox select all component. The idea is that there is a component and

3条回答
  •  天涯浪人
    2021-01-02 17:07

    I came across to this thread very late. Below solution works for me with below structure.

    There are 3 components which makes this feature clean and reusable.

    1. CheckBox - Reusable Component
    2. CheckBoxList - Reusable Component
    3. CityList - End level where you can create states list or any list by cloning this.

    Stack Blitz with Module - https://stackblitz.com/edit/react-check-box-list

    Standlone Code is below

    
    
        
            
            React: Select All or DeSelect All
            
            
            
            
        
        
            

提交回复
热议问题