Answers for "react how to manipulate children"

1

react how to manipulate children

class IgnoreFirstChild extends React.Component {
  render() {
    const children = this.props.children
    return (
      <div>
        {React.Children.map(children, (child, i) => {
          // Ignore the first child
          if (i < 1) return
          return child
        })}
      </div>
    )
  }
}
Posted by: Guest on September-17-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language