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

[typescript - 2.2] Support for spread operator on JSX element children #42

Open
kennyd98 opened this issue Jul 11, 2017 · 0 comments
Open
Assignees
Labels

Comments

@kennyd98
Copy link

kennyd98 commented Jul 11, 2017

function Todo(prop: { key: number, todo: string }) {
    return <div>{prop.key.toString() + prop.todo}</div>;
}

function TodoList({ todos }: TodoListProps) {
    return <div>
        {...todos.map(todo => <Todo key={todo.id} todo={todo.todo} />)}
    </div>;
}

let x: TodoListProps;

<TodoList {...x} />
@kennyd98 kennyd98 self-assigned this Jul 11, 2017
@kennyd98 kennyd98 added 발표 and removed 발표 labels Jul 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant