-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use forwardRef for all the simple wrapper components just in case
- Loading branch information
Showing
4 changed files
with
20 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
import {type ComponentPropsWithoutRef} from 'react'; | ||
import {type ComponentPropsWithoutRef, forwardRef} from 'react'; | ||
import {classes} from '../../util/ui_interop'; | ||
import css from './ActionButton.module.css'; | ||
|
||
export const ActionButton = ({ | ||
export const ActionButton = forwardRef<HTMLButtonElement>(({ | ||
inline, | ||
className, | ||
...props | ||
}: ComponentPropsWithoutRef<'button'> & { | ||
inline?: boolean; | ||
}) => ( | ||
}, ref) => ( | ||
<button | ||
className={classes(css.actionButton, inline && css.inline, className)} | ||
{...props} | ||
ref={ref} | ||
/> | ||
); | ||
)); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
import {type ComponentPropsWithoutRef} from 'react'; | ||
import {type ComponentPropsWithoutRef, forwardRef} from 'react'; | ||
import {classes} from '../../util/ui_interop'; | ||
import css from './ActionSelect.module.css'; | ||
|
||
export const ActionSelect = ({ | ||
export const ActionSelect = forwardRef<HTMLSelectElement>(({ | ||
inline, | ||
className, | ||
...props | ||
}: ComponentPropsWithoutRef<'select'> & { | ||
inline?: boolean; | ||
}) => ( | ||
}, ref) => ( | ||
<select | ||
className={classes(css.actionSelect, inline && css.inline, className)} | ||
{...props} | ||
ref={ref} | ||
/> | ||
); | ||
)); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
import {type ComponentPropsWithoutRef} from 'react'; | ||
import {type ComponentPropsWithoutRef, forwardRef} from 'react'; | ||
import {classes} from '../../util/ui_interop'; | ||
import css from './BracketButton.module.css'; | ||
|
||
export const BracketButton = ({ | ||
export const BracketButton = forwardRef<HTMLButtonElement>(({ | ||
inline, | ||
className, | ||
...props | ||
}: ComponentPropsWithoutRef<'button'> & { | ||
inline?: boolean; | ||
}) => ( | ||
}, ref) => ( | ||
<button | ||
className={classes(css.bracketButton, className)} | ||
{...props} | ||
ref={ref} | ||
/> | ||
); | ||
)); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
import {type ComponentPropsWithoutRef} from 'react'; | ||
import {type ComponentPropsWithoutRef, forwardRef} from 'react'; | ||
import {classes} from '../../util/ui_interop'; | ||
import css from './GeneralButton.module.css'; | ||
|
||
export const GeneralButton = ({ | ||
export const GeneralButton = forwardRef<HTMLButtonElement>(({ | ||
inline, | ||
className, | ||
...props | ||
}: ComponentPropsWithoutRef<'button'> & { | ||
inline?: boolean; | ||
}) => ( | ||
}, ref) => ( | ||
<button | ||
className={classes(css.generalButton, className)} | ||
{...props} | ||
ref={ref} | ||
/> | ||
); | ||
)); |