- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Shyam Hande has Published 72 Articles
Shyam Hande
2K+ Views
Composition and inheritance are the approaches to use multiple components together in React.js . This helps in code reuse. React recommend using composition instead of inheritance as much as possible and inheritance should be used in very specific cases only.Example to understand it −Let’s say we have a component to ... Read More
Shyam Hande
514 Views
Often there will be a need to share state between different components. The common approach to share state between two components is to move the state to common parent of the two components. This approach is called as lifting state up in React.jsWith the shared state, changes in state reflect ... Read More
Shyam Hande
324 Views
In controlled component form data is handled by React component by writing event handler for state updates. But in uncontrolled component, form data is handled by DOM itself.ref is used to receive the form value from DOM.Exampleclass UserNameForm extends React.Component { constructor(props) { super(props); ... Read More
Shyam Hande
259 Views
In simple html form, the form elements keeps value with it internally and submit on form submission button.Example Form Example User Name: In above example, we have a simple input ... Read More
Shyam Hande
411 Views
Displaying a list on UI in ReactMap is JavaScript function which will return a new array for provided array as shown below −const originalNumbers = [ 2, 4, 6, 8, 10]; const squaredNumbers = originalNumbers.map( (number)=> number * number); console.log(“Squared Numbers==”squaredNumbers);Building a list in React is similar with the use ... Read More
Shyam Hande
265 Views
Using conditional statements specific components can be rendered and removed . Conditional handling works similarly in JavaScript and React.jsExamplefunction DisplayUserMessage( props ){ const user = props.user.type; if(type==’Player’){ return Player ; } If( type==’Admin’){ Return Admin ; } }If statement ... Read More
Shyam Hande
426 Views
There are some syntactical differences in writing events but it is handled similar to DOM elements event handling.The name of event handlers are written in camel case notations.ExampleEvent in simple html − Add User Event in React with jsx: Add User One of the difference is ... Read More
Shyam Hande
284 Views
State and lifecycle of component is very powerful to make things work in a dynamic applications.StateState is generally used in Stateful component. With the introduction of hook, we can add state in functional component as well now . The name of the hook is useState.State is a JavaScript object which ... Read More
Shyam Hande
167 Views
React applications are made up of components. Component are generally uses react elements. Components can be independent, reusable pieces.There are two types of components −Stateless component ( Basically JavaScript functions )Stateful component ( Uses JavaScript class feature )Both the components types receives a proprieties object generally called as props.Stateless component ... Read More
Shyam Hande
565 Views
The smallest building blocks of React applications are the elements. Example of an element is −const message = Welcome, Steve;React DOM updates the actual DOM with the converted react elements. React components are made up of elements.Rendering element on DOMWe will have a parent div element in the main html ... Read More