Skip to content

Instantly share code, notes, and snippets.

@renderlife
Last active October 27, 2022 12:08
Show Gist options
  • Save renderlife/31b19381764319f367eec4999498de47 to your computer and use it in GitHub Desktop.
Save renderlife/31b19381764319f367eec4999498de47 to your computer and use it in GitHub Desktop.
ts_component.tsx
// Libs
// Styles
import styles from './styles.module.sass'
import commonStyles from '@Styles/common.module.sass'
import cn from 'classnames'
// Utils
// Components
import AuthInput from '@Components/Common/Inputs/AuthInput/AuthInput'
// Icons
import { ReactComponent as CommentIcon } from 'Images/comment-black.svg'
// Constants
import { AUTH_PATH } from '@Constants/patch'
// Types and Models
import { SettingsType } from '@Types/settings.d'
// Libs
// Styles
// Utils
// Components
// Icons
// Constants
// Types and Models
const foo = useMemo(() => {
return bar
}, [baz])
const handleFoo = useCallback((value) => {
onChange(value)
}, [onChange])
const [foo, setFoo] = useState<Boolean>(true)
import React, { useCallback } from 'react'
import commonStyles from '@Styles/common.module.sass'
import styles from './styles.module.sass'
import cn from 'classnames'
export type Props = {
id: number
onClick: (id: number) => void
title: string
}
export default function ButtonAsLink(props: Props): JSX.Element {
const { id, onClick, title } = props
const handleClick = useCallback(() => {
onClick(id)
}, [id, onClick])
return (
<div className={styles.link} onClick={handleClick} title={title}>
{title}
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment