You get a bonus - 1 coin for daily activity. Now you have 1 coin

What are fragments? in REACT

Practice



 

This is a common pattern in React used to return components with several elements. Fragments let you group a list of children without adding extra nodes to the DOM.

 render() {
  return (
    <React.Fragment>
      <ChildA />
      <ChildB />
      <ChildC />
    </React.Fragment>
  )
}

There is also a shorter syntax , but it is not supported in many tools:
 render() {
  return (
    <>
      <ChildA />
      <ChildB />
      <ChildC />
    </>
 )
}

This is a common pattern in React used to return components with several elements. Fragments let you group a list of children without adding extra nodes to the DOM.

render () {  return ( < React.Fragment > < ChildA /> < ChildB /> < ChildC /> </ React.Fragment > ) }

There is also a shorter syntax , but it is not supported in many tools:

render () {  return (  <> < ChildA /> < ChildB /> < ChildC /> < / > 
 ) 
}

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Scripting client side JavaScript, jqvery, BackBone"

Terms: Scripting client side JavaScript, jqvery, BackBone