Categories
Javascript

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 […]

Categories
Javascript

How to check that javascript object contains the given key?

A wet man does not fear the rain. Issue:-How do I check if an object has a key in JavaScript? Example:- // Sample Object const REMINDER = “REMIND_ME”; reminderObj= { INBOX:`${REMINDER}_INBOX`, USERS:`${REMINDER}_USERS`, GROUPS:`${REMINDER}_GROUPS`, } Problem1: Now we want to check that our object have “INBOX” as key or not? Solution:-  Object.prototype.hasOwnProperty.call(reminderObj,”INBOX”); Note:- We could directly […]

Categories
Javascript

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 […]

Categories
Javascript

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. […]

Categories
Javascript

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:- […]

Categories
Javascript

Up and Running with React in 10 minutes

“All great achievements require time…. Maya Angelou”We already learned how to create our first Angular.io App in 10 minutes, this time we’ll repeat the same with React library.So lets get started.Key terminologies in react appBrush up :-We already know that in React we play with Javascript and embed html inside the jsx files to create […]

Categories
Javascript

Creating your first app using Angular.io

Do something today that your future self will thank you for We have created this tutorial to make you up and running with Angular.io in 10 minutes. This is not a very detailed tutorial incase you are not familiar with Angular basics, please refer Angular.io documentation to get more details on the core concepts.Expectation:- We’ll create our […]

Categories
Javascript

Javascript Interview Questions(Part-4)

JavaScript Coding interview questions with solutions:-Question1:- You would like to set a password for a bank account. However, there are three restrictions on the format of the password:it has to contain only alphanumerical characters (a−z, A−Z, 0−9);there should be an even number of letters;there should be an odd number of digits.You are given a string […]

Categories
Javascript

Vue.js npm run dev error with vue-cli

Problem:- On running the npm run dev, command after installing vue-cli, following error is thrown?Starting dev server…events.js:160      throw er; // Unhandled ‘error’ event      ^ Error: listen EADDRINUSE :::8080    at Object.exports._errnoException (util.js:1026:11)    at exports._exceptionWithHostPort (util.js:1049:20)    at Server._listen2 (net.js:1262:14)    at listen (net.js:1298:10)    at Server.listen (net.js:1376:9)…. Solution:-From above error we can get an hint “listen EADDRINUSE :::8080”,issue is […]

Categories
Javascript

How to call Javascript/VBS functions in Robot Framework.

Scenario:-How we can call javascript/vbs functions in Robot Framework?Solution:- VBS:-Using the python function to call the VBS file. Download the working code. Javascript:-Using the inbuilt Keyword in Selenium2Lib called as “Execute Javascript“. Learn Robot Framework