From e712a054ae347ffa3910cecd8de5c3f2c8466810 Mon Sep 17 00:00:00 2001 From: Marshall Polaris Date: Sun, 5 Jun 2022 18:57:49 -0700 Subject: [PATCH] Fix line endings --- web/components/checkbox.tsx | 62 ++++++++++++++++++------------------- web/hooks/use-event.ts | 40 ++++++++++++------------ 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/web/components/checkbox.tsx b/web/components/checkbox.tsx index df24ab6b..9cc7cae9 100644 --- a/web/components/checkbox.tsx +++ b/web/components/checkbox.tsx @@ -1,31 +1,31 @@ -import clsx from 'clsx' - -export function Checkbox(props: { - label: string - checked: boolean - toggle: (checked: boolean) => void - className?: string -}) { - const { label, checked, toggle, className } = props - - return ( -
-
-
- toggle(!e.target.checked)} - /> -
-
- -
-
-
- ) -} +import clsx from 'clsx' + +export function Checkbox(props: { + label: string + checked: boolean + toggle: (checked: boolean) => void + className?: string +}) { + const { label, checked, toggle, className } = props + + return ( +
+
+
+ toggle(!e.target.checked)} + /> +
+
+ +
+
+
+ ) +} diff --git a/web/hooks/use-event.ts b/web/hooks/use-event.ts index 443e1095..eb1c7b11 100644 --- a/web/hooks/use-event.ts +++ b/web/hooks/use-event.ts @@ -1,20 +1,20 @@ -// A hook soon to be added to the React core library: -// https://github.com/reactjs/rfcs/blob/useevent/text/0000-useevent.md -// TODO: Once React adds this hook, use it instead. - -import { useRef, useLayoutEffect, useCallback } from 'react' - -type AnyFunction = (...args: any[]) => any - -export function useEvent(callback?: T) { - const ref = useRef(() => { - throw new Error('Cannot call an event handler while rendering.') - }) - useLayoutEffect(() => { - ref.current = callback - }) - return useCallback( - (...args) => ref.current?.apply(null, args), - [] - ) as T -} +// A hook soon to be added to the React core library: +// https://github.com/reactjs/rfcs/blob/useevent/text/0000-useevent.md +// TODO: Once React adds this hook, use it instead. + +import { useRef, useLayoutEffect, useCallback } from 'react' + +type AnyFunction = (...args: any[]) => any + +export function useEvent(callback?: T) { + const ref = useRef(() => { + throw new Error('Cannot call an event handler while rendering.') + }) + useLayoutEffect(() => { + ref.current = callback + }) + return useCallback( + (...args) => ref.current?.apply(null, args), + [] + ) as T +}