What's the difference between import React from 'react'
and import React { Fragment } from 'react'
in context of <React.Fragment>
, <Fragment>
and <>
?
I mean what happen when we import React
and { Fragment }
in the same line from a module?
Do we create instance of <Fragment>
and this is just another few hundreds lines of code under the hood?
Or this is just normal and everybody can do that withouth performance downsides?
Official React blogpost mention that you can do this const Fragment = React.Fragment
and they use in in their examples.
But why?