Created
January 12, 2021 17:48
-
-
Save bnayae/8c438f849a9b948bff430c802d1a8216 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { RecoilState } from 'recoil'; | |
export interface IStarsPickerProps { | |
state: RecoilState<number>; | |
} | |
export const StarsPicker =({ state }: IStarsPickerProps) => { | |
const [value, setValue] = useRecoilState(state); | |
return ( | |
<ReactStars | |
name="raring" | |
value={value} | |
onStarClick={(r: number) => setValue(r)} | |
/> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment