How to do it?

Import React component

import React, {Component} from 'react';

Create constant function

import React, {Component} from 'react';

const Paragraph = () => {
}

Make it return JSX component

import React, {Component} from 'react';

const Paragraph = () => {
    return(
        <div>
            <p>Hello, React!</p>
        </div>
    );
}

Import ReactDOM and send component to specific element of DOM, using it's CSS-class

import React, {Component} from 'react';
import ReactDom from 'react-dom';

const Paragraph = () => {
    return(
        <div>
            <p>Hello, React!</p>
        </div>
    );
}

ReactDOM.render(<Paragraph/>, document.querySelector('.container'));

results matching ""

    No results matching ""