Quick Contact


    React Fragment

    It is basic concept of React. Fragment helps to return multiple elements. Fragments let you group a list of children element. For writing different elements

    tag is used. If

    tag is replaced with fragment then it prevent extra node from added to the DOM. Example is given below-:

    		Import React from ‘react’
    		Function FragmentDemo() {
    		Return (
    		< React.Fragment>
    		     < h1>FragmentDemo < /h1>
    		      < p>....... < /p>
    		< /React.Fragment>
    		)
    		}
    		Export default FragmentDemo
    	

    As suppose a component table that renders HTML table and inside that table columns are rendered with another component called columns.

    		Class table extends react.Component {
    		Render() {
    		  Return (
    		< table>
    		< tr>
    		     < columns/>
    		< /tr>
    		< /table>
    		);
    		}
    		}
    		Class Columns extends react.Component {
    		 Render() {
    		Return (
    		< div>
    		< td>hii< /td>
    		< td>ducat< /td>
    		);
    		}
    		}
    	

    Copyright 1999- Ducat Creative, All rights reserved.