Commit Graph

2 Commits

Author SHA1 Message Date
Alexander Chudesnov
6922165cbb Allow children in stateless components’ props
This allows passing children to `StatelessComponent<P>` exactly like base components without the need to use React.Props<T> or extending the P interface with an explicit 'children' property:

# Before
````typescript
    type FooProps = {
      bar: number;
    }
    const Foo: React.SFC<FooProps> = props => (
      <div>
        {props.children} = {props.bar} // error TS2459: Type 'FooProps' has no property 'children' and no string index signature.
      </div>
    );
````

# After
````typescript
    type FooProps = {
      bar: number;
    }
    const Foo: React.SFC<FooProps> = props => (
      <div>
        {props.children} = {props.bar}
      </div>
    );

    <Foo bar="42">6×9</Foo> // <div>6×9 = 42</div>
````
2016-11-09 21:58:54 +03:00
Paul van Brenk
2a10e28ad4 New typings migrated to 2.0 2016-08-18 16:39:16 -07:00