React stateless components pass parameters

parent component:

this.state = {
    items: ["beijing", "shanghai"]
}
<div>
    <List items={this.state.items}
</div>

const List = (items) = > (

)
<div>
    <ul>
        {items.map(item => <li key={item}>{item}</li>}
    </ul>
</div>

)
will report an error items.map is not function,. What is the reason for this?
class List extends Component {


render() {
    return (
        <div>
            <ul>
                {this.props.items.map(item => <li key={item}>{item}</li>)}
            </ul>
        </div>
    )
}

}
so that no error will be reported.

May.27,2021

use function argument structure

const List = ({items}) => (

<div>
    <ul>
        {items.map(item => <li key={item}>{item}</li>}
    </ul>
</div>
)

the first parameter of a stateless component is: props

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e54af3-44a5c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e54af3-44a5c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?