Framework Report React
Framework Report React
for React
1. Introduction
Correctly speaking, React is not a framework at all. Technically, developers refer to
React as a front-end library to assist in building functionality for projects. However,
almost universally, developers still use React as a framework and continue to discuss
and compare it with other web frameworks. Therefore, React remains a framework like
any other framework in this article.
React is a declarative, efficient, and flexible JavaScript library for building user
interfaces. It enables you to create complex user interfaces (UIs) from small,
independent pieces of code.
2.4. State
State is a built-in feature in React that allows components to manage their own
data. Unlike props, which are passed down from parent components and are
immutable, state is mutable and managed internally by the component. When
a component’s state changes, React automatically re-renders the component
and its children to reflect the new state.
2.9. Redux
While not part of React.js itself, Redux is often used alongside React for
managing global state in larger applications. Redux provides a predictable state
container that can be used with any JavaScript framework or library, including
React. It helps in managing complex application state and makes data flow
more predictable.
3. Utilizing Components
3.1. Virtual DOM
React handles the virtual DOM automatically behind the scenes. You don't
directly interact with the virtual DOM; instead, you work with React's
component-based architecture and state management, and React takes care
of updating the actual DOM efficiently.
3.2. JSX
JSX allows you to write HTML-like code within JavaScript. To use JSX, simply
include it within your React component files. JSX gets transformed into regular
JavaScript by tools like Babel during the build process.
3.3. Props
To pass data from a parent component to a child component, you simply add
attributes to the child component when rendering it. In the child component,
you access these props through the props object.
3.4. State
To use state in a component, you initialize it in the component's constructor (for
class components) or using the useState hook (for functional components).
You can then update the state using setState (for class components) or the
function returned by useState (for functional components).
3.5. Hook
To use hooks in functional components, you simply import them from the react
package and call them within the component body. For example, useState for
managing state and useEffect for performing side effects.
6. Conclusion
6.1. React is a declarative, efficient, and flexible JavaScript library for building user
interfaces. It enables you to create complex user interfaces (UIs) from small,
independent pieces of code.
6.2. Main reasons for choosing Reacts for this project
6.2.1. React contributes to accelerating development speed, reducing
research time, and effort for team members.
6.2.2. React help modulize and reuse some UI components of the software
especially software Event Management functionality where Event
Cards will be requested and displayed mutiple times in different pages
of the website.
6.2.3. State and Hook functionality of this project helps constant UI update
whenever there are changes made to the data.