A
A
AltaiR2019-11-15 14:45:51
React
AltaiR, 2019-11-15 14:45:51

Which approach is better?

Hello. Which one is better to use:
1.

import React from 'react';

class App extends React.Component {
  <React.Fragment>...</React.Fragment>
}

2.
import React, { Component, Fragment } from 'react';

class App extends Component {
  <Fragment>...</Fragment>
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
vadimMalovaniy, 2019-11-15
@AltaiR-05

import React, { Component } from 'react';

class App extends Component {
  <>...</>
}

A
abberati, 2019-11-15
@abberati

import React from 'react'

const App = () => <></>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question