DEV Community

Cover image for ReactJS .. the library

ReactJS .. the library

bekbrace profile image Bek Brace Updated on ・2 min read

React is a JavaScript library for building User Interface, developed at Facebook and released in 2013; and I think it's safe to say that React has been the most influential UI library of recent memory.

BTW, here's my recent React JS tutorial for backend developers to connect Django backend with React frontend using Axios

We use it to build components to represent logical reusable parts of the UI, the beauty of React is that the simplicity of building a component has been brought down to its theoretical minimum ; it's just a JavaScript function and the return value from that function is your html or UI which is written in special syntax called "JSX".
JSX allows you to combine JavaScript with html markup, if you want to pass data into a component, you simply pass it a props argument which you can then reference inside the function body or in the UI using braces, and if the value changes , React will "react" to update the UI.

If you want to to give your component its own internal state, we can use the state hook, and the hook is just a function that returns a value as well as a function to change the value

function foo() {
const [count, setcount ] = useState()

In this example, count is our reactive state and setcount will change the state.

The main reason you might want to use React is not the library itself, but the massive ecosystem that surrounds it, React itself does not care about routing, state management , instead it lets those concerns evolve naturally within the open source community no matter what you're trying to do, it's very likely that you'll find a supporting library to help get it done

If you need a static site, you have : [ Gatsby, Static Site ]

If you need a a server-side rendering, you got Next.JS
For state management, you have Redux, Flux , Mobx and Recoil

You have an endless amounts of vehicules that can get the job done based on your needs.
Once you have React down, you can easily jump into react native and and start building mobile apps, and it's no surprise that knowing this little ui library is one of the most demand skills for front end developers today

Discussion (0)

Editor guide