Skip to content

property children not found in props of React element ... #1964

@MoOx

Description

@MoOx

This issue showed when I upgraded from 0.25 to 0.27...

I think I am still having issue.

Here is a component

// @flow

import React from "react"
import { StyleSheet, View } from "react-native"

type Props = {
  children: ReactElement,
}

const NavigationBar = (props: Props): ReactElement => {
  return (
    <View
      accessibilityRole={ "menubar" }
      style={ styles.bar }
    >
      <View style={ styles.center }>
        { props.children }
      </View>
    </View>
  )
}

NavigationBar.defaultProps = {
  children: null,
}

const styles = StyleSheet.create({
  // ...
})

export default NavigationBar

And here is a place where it is throwing errors

// ...
const Header = (props: Props): ReactElement => {
  const { user } = props

  return (
    <NavigationBar> // <- HERE I AM THE ERROR: property `children` not found in props of React element `NavigationBar`
      <View style={ styles.left }>
// ...

Looks like a bug. Or maybe I am doing something wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions