Answer the question
In order to leave comments, you need to log in
How to import multiple components from app.js in react?
There is app.js which contains two components:
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
class App extends Component {
render() {
return (
<div className="app">
какой-то текст.
</div>
);
}
}
export default App;
class Gap extends Component {
render() {
return (
<div className="apps">
какой-то текст 2
</div>
);
}
}
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import {Gap} from './App';
import registerServiceWorker from './registerServiceWorker';
ReactDOM.render(<App/> , document.getElementById('root'));
registerServiceWorker();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question