Skip to content

Instantly share code, notes, and snippets.

@bnayae
Created January 12, 2021 17:48
Show Gist options
  • Save bnayae/8c438f849a9b948bff430c802d1a8216 to your computer and use it in GitHub Desktop.
Save bnayae/8c438f849a9b948bff430c802d1a8216 to your computer and use it in GitHub Desktop.
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