React js Tutorial For Beginners - step by step

spread and rest operator 

spread : same as in php add value in array

let cars = ["audi","bmw"];
let new_cars = [...cars,"maruti"];


rest operator

we can use it to pass multiple argument in single argument

function demo(...all){
    console.log(all.a)
}
demo(1,2,3,4,5);

 

create react app

npx or npm : the package manage

npx create-react-app app-name

install bootstrap

npm install bootstrap

Importing Bootstrap CSS

In your React application, you can import Bootstrap's CSS file in your entry point file (usually index.js or App.js):

import 'bootstrap/dist/css/bootstrap.min.css';
 

Importing Bootstrap JavaScript (Optional)

If you need Bootstrap's JavaScript components (such as modals, tooltips, etc.), you can also import Bootstrap's JavaScript file. However, it's important to note that if you're using React, you should prefer React-specific solutions (like React Bootstrap) for UI components instead of relying on Bootstrap's JavaScript.

If you still need to use Bootstrap's JavaScript, you can import it like this:

import 'bootstrap/dist/js/bootstrap.bundle.min.js';

[ Avoid to use jquery in react ]

1. Install jQuery: You can install jQuery using npm or yarn:

npm install jquery


2. 
Import jQuery: In your React component where you need to use jQuery, import it like any other module:

import $ from 'jquery';

3.Use jQuery: You can then use jQuery within your component as needed. For example:

$(document).ready(function() {
// jQuery code here
});
 

 fortawesome with react

npm install --save @fortawesome/fontawesome-svg-core
npm install --save @fortawesome/free-solid-svg-icons
npm install --save @fortawesome/react-fontawesome
 

  
 


 


Post a Comment

Previous Post Next Post