Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[03/06] 8장: 8장 JSX에서 TSX로 #90

Open
loopy-lim opened this issue Mar 5, 2024 · 0 comments
Open

[03/06] 8장: 8장 JSX에서 TSX로 #90

loopy-lim opened this issue Mar 5, 2024 · 0 comments
Assignees

Comments

@loopy-lim
Copy link
Collaborator

  • 여러분들은 React.FC를 적용하시나요?

  • 솔직히 이건 좀 보고 놀랐어요.

    declare global {
    	namespace JSX {
    		inerface Element extends React.ReactElement<any, any> {}
    	}
    }
  • ReactElement와 ReactNode는 언제 어디서 사용할 수 있을까요?

    • ReactElement와 JSX.Element의 차이점에서 props타입을 적을 수 있다는게 놀랍네요.
  • 최근 프로젝트에서 이야기 했었던 것도 나왔었네요. DetailedHTMLProps, ComponsntWithoutRef

  • 제네릭 컴포넌트

    interface SelectProps<OptinoType extends Record<string, string>> {
    	option: OptionType;
    	selectedOption?: keyof OptionType;
    	onChange?: (selected?: keyof OptionType) => void;
    }
    
    const Select = <OptionType extends Records<string, string>>({
    	options,
    	selectedOption,
    	onChange,
    }: SelectProps<OptionType>) => {
    	// Select component implementation
    };
@loopy-lim loopy-lim self-assigned this Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant