Want to be a React Developer? Know this basic.

What is React and why we call it a library, not a framework?

Time-Saving:

Quick Development:

Faster Testing:

Code Stability with One-directional data-binding:

import React from 'react';
import ReactDOM from 'react-dom';

const myelement = React.createElement('h1', {}, 'I am not using JSX!');

ReactDOM.render(myelement, document.getElementById('root'));

//Output: I am not using JSX.
import React from 'react';
import ReactDOM from 'react-dom';

const myelement = <h1> I am using JSX!</h1>;

ReactDOM.render(myelement, document.getElementById('root'));
//output: I am using JSX!

Presets in Babel:

Virtual Dom and Real Dom
import PropTypes from 'prop-types';

class Greeting extends React.Component {
render() {
return (
<h1>Hello, {this.props.name}</h1>
);
}
}

Greeting.propTypes = {
name: PropTypes.string
};
class CustomButton extends React.Component {
// ...
}

CustomButton.defaultProps = {
color: 'blue'
};
render() {
return <CustomButton /> ; // props.color will be set to blue
}
render() {
return <CustomButton color={null} /> ; // props.color will remain null
}

Using the Production Build :

npm run build
<script src="https://unpkg.com/react@17/umd/react.production.min.js"></script><script src="https://unpkg.com/react-dom@17/umd/react-dom.production.min.js"></script>

Brunch:

npm install --save-dev terser-brunch

Then, to create a production build, add the -p flag to the build command:

brunch build -p

--

--

--

An Aspiring Mern Stack Developer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Advanced Mixins in Styled-Components

Basics of Node.JS

Optimize WordPress Database Queries with Query Monitor

React to this, React!

storm looper

Deploy React

Setting up testing with Jest and Node.js

useSetInterval react hook — easy way to call a function every n seconds

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mezbaul Abedin Forhan

Mezbaul Abedin Forhan

An Aspiring Mern Stack Developer

More from Medium

How destructuring saved the day

A simple guide to using useEffect.

React Developer Switzerland: A Small Guide

Post-Punk Records and Living in a React State: useState for Dummies