voronianski / react-star-rating-component

Basic React component for star (or any other icon based) rating elements
http://voronianski.github.io/react-star-rating-component/example
MIT License
380 stars 77 forks source link

React redux form? #38

Closed kevinkashou closed 7 years ago

kevinkashou commented 7 years ago

What is the best way to integrate this library to the react redux form?

<Field model='user.rating' >
                        <StarRatingComponent
                            name='user.rating'
                            starCount={5}
                            value={0}
                            id='user.rating'
                        />
                    </Field>

This is what I have but it is not grabbing the data on submit of form.

kevinkashou commented 7 years ago

I solved it with the following ....

            <Field model={this.props.model} id={this.props.model} mapProps={{customChange: props => props.change}}>
                <ReactStars
                    count={5}
                    half={false}
                    size={24}
                    color1={'#000013'}
                    color2={'#ffd700'}
                />
            </Field>