How are Actions defined in React.js?

Answer

Actions in React must have a type property that indicates the type of ACTION being performed.
They must be defined as a String constant and you can add more properties to it as well.
In Redux, actions are created using the functions called Action Creators.
example of Action and Action Creator:

function addTodo(text) {
return {
type: ADD_TODO,
text
}
}

All react js Questions

Ask your interview questions on react-js

Write Your comment or Questions if you want the answers on react-js from react-js Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---