AlexGilleran / jsx-control-statements

Neater If and For for React JSX
https://www.npmjs.com/package/babel-plugin-jsx-control-statements
MIT License
1.62k stars 64 forks source link

TypeScript type for children is missing a render function #107

Closed thitemple closed 2 years ago

thitemple commented 3 years ago

Hi this is adding a type for TChildren that allows components with children with render functions, without this, we have a TS error for the following:

function Component() {
  return (
     <SomeOtherComponent>
      {(props) => (<div>{props.something}</div>)}
     </SomeOtherComponent>
  )
}

I have sent a PR for this already, it's just missing one line

AlexGilleran commented 2 years ago

Resolved in #106