10 Libraries You Should Know as a React Developer

Image
 Being a modern React developer is not about knowing just React itself. To stay competitive, it is highly recommended to explore the whole ecosystem In this article I've compiled some of the most useful React component libraries that you could use to speed up your developer workflow. Those will include anything from working with forms, charts, calendars, tables, guides, popups, colors, animations, music, images and so much more. 1. react-hook-form React Hooks for form state management and validation. 2. recharts Redefined chart library built with React and D3. 3. react-big-calendar An events calendar built for React and modern browsers. 4. react-beautiful-dnd Beautiful and accessible drag and drop for lists with React. 5. react-table A library for building powerful tables and data grids. 6. react-joyride Create guided tours for your apps. 7. react-advanced-cropper Create customized crops for your designs. 8. react-colorful A tiny, dependency-free, fast and accessible color picker c...

Javascript Closures

The previous line is hard to understand because its about closures which is a very critical concept in Javascript.In this blog we will take a look at Javascript closures and will try to make it simplke for you all.



JavaScript allows writing function inside an outer function. We can write as many inner functions as we want. If inner function access the variables of outer function then it is called closure.


function outerFunction() {

    let count = 0;

    function innerFunction() {

        count++

        return count

    }

    return innerFunction

}

const innerFunc = outerFunction()


console.log(innerFunc())

console.log(innerFunc())

console.log(innerFunc())

//1

//2

//3


Let us more example of inner functions


function outerFunction() {

    let count = 0;

    function plusOne() {

        count++

        return count

    }

    function minusOne() {

        count--

        return count

    }

    return {

        plusOne:plusOne(),

        minusOne:minusOne()

    }

}

const innerFuncs = outerFunction()

console.log(innerFuncs.plusOne)

console.log(innerFuncs.minusOne)


Closures make JavaScript very powerful and versatile. Closure helps in data encapsulation, remove redundant code, etc.

In other languages this won't work but in JavaScript it works.

Comments