React

How to debug jest test cases(React)?

Adding test cases to your code always helps in the long run, today we’re going to talk about how to debug test cases. Do something today that your future self will thank you for Using our all time favourite Console.log it(‘should call touch & asyncValidate methods’, () => { const component = shallow( <TrialRegistrationForm handleSubmit={mockHandleSubmit} […]

Posted in Javascript | Tagged , | Leave a comment

How to add CSS modules into your react Application?

“Believe in yourself && Keep Learning” Step1:- In our example we have take “create-react-app” template as reference. Install this and than perform “yarn eject” What is yarn eject:- it will give you control of the create-react-app and you can install or play with config settings or package.json file. Step2:- Search for “css-loader” inside the file […]

Posted in Javascript | Tagged | Leave a comment

How to use FormattedMessage for input placeholder in React?

Problem:- How we can translate the placeholder text for input-box using formatmessage? Solution:- If we use react-intl its not meant to be used with  placeholders, alternate text, etc. They render HTML, not plain text, which is not useful in our scenario. 1. Incase we have one or two values to translate, we can use FormattedMessage as wrapper […]

Posted in Javascript | Tagged | Leave a comment

Working with React-Router?

“An investment in knowledge pays the best interest.” Benjamin FranklinIn our previous post we started with creating our first react app and than we learned about some basic terminologies in react. Today we are going to focus on creating the router behaviour using react library.Incase you want to learn about filtering in react check the github code. […]

Posted in Javascript | Tagged | Leave a comment

Important terms when starting with React.

We already created our first react app using create-react-app cli. Now we’ll learn some of the core terminologies involved in react.1.Component :- its the building block of react app, just like functions, we create components to perform some functionality. It takes the given parameters (called as props) and render UI in the browser by consuming the given parameters.Example:- […]

Posted in Javascript | Tagged | Leave a comment