What is flux?

Posted by Prem Tiwari | Updated on | ReactJS interview


What is flux? Flux is an application design paradigm used as a replacement for the more traditional MVC pattern. It is not a framework or a library but a new kind of architecture that complements …

What are the advantages of Jest over Jasmine?

Posted by Prem Tiwari | Updated on | ReactJS interview


What are the advantages of Jest over Jasmine? There are couple of advantages compared to Jasmine: Automatically finds tests to execute in your source code. Automatically mocks dependencies when running your tests. Allows you to …

What is Jest?

Posted by Prem Tiwari | Updated on | ReactJS interview


What is Jest? Jest is a JavaScript unit testing framework created by Facebook based on Jasmine and provides automated mock creation and a jsdom environment. It’s often used for testing components.

What is the purpose of ReactTestUtils package?

Posted by Prem Tiwari | Updated on | ReactJS interview


What is the purpose of ReactTestUtils package? ReactTestUtils are provided in the with-addons package and allow you to perform actions against a simulated DOM for the purpose of unit testing.

What is TestRenderer package in React?

Posted by Prem Tiwari | Updated on | ReactJS interview


What is TestRenderer package in React? This package provides a renderer that can be used to render components to pure JavaScript objects, without depending on the DOM or a native mobile environment. This package makes …

What is Shallow Renderer in React testing?

Posted by Prem Tiwari | Updated on | ReactJS interview


What is Shallow Renderer in React testing? Shallow rendering is useful for writing unit test cases in React. It lets you render a component one level deep and assert facts about what its render method …

How to use as placeholder using React Intl?

Posted by Prem Tiwari | Updated on | ReactJS interview


How to use as placeholder using React Intl? The components from react-intl return elements, not plain text, so they can’t be used for placeholders, alt text, etc. In that case, you should use lower level …

Upgrade to PHP 7.3 or 7.2 on macOS Mojave, Sierra or on OSX 10.6 – 10.11

Posted by Prem Tiwari | Updated on | Mac OS PHP


macOS Mojave ships with PHP 7.1, High Sierra 7.1,  Sierra ships with PHP 5.6, OSX 10.11 El Capitan with PHP 5.5.x, there is an easy upgrade method to either the latest PHP version 7.3 or 7.2  or …

What are the main features of React Intl?

Posted by Prem Tiwari | Updated on | ReactJS interview


What are the main features of React Intl? Below are the main features of React Intl, Display numbers with separators. Display dates and times correctly. Display dates relative to “now”. Pluralize labels in strings. Support …

What is React Intl?

Posted by Prem Tiwari | Updated on | ReactJS interview


What is React Intl? The React Intl library makes internalization in React straightforward, with off-the-shelf components and an API that can handle everything from formatting strings, dates, and numbers, to pluralization. React Intl is part …

How to implement default or NotFound page?

Posted by Prem Tiwari | Updated on | ReactJS interview


How to implement default or NotFound page? A renders the first child that matches. A with no path always matches. So you just need to simply drop path attribute as below:

How to get query parameters in React Router v4?

Posted by Prem Tiwari | Updated on | ReactJS interview


How to get query parameters in React Router v4? The ability to parse query strings was taken out of React Router v4 because there have been user requests over the years to support different implementation. …

What is the purpose of push() and replace() methods of history?

Posted by Prem Tiwari | Updated on | ReactJS interview


What is the purpose of push() and replace() methods of history? A history instance has two methods for navigation purpose. push() replace() If you think of the history as an array of visited locations, push() will add a new location to the …

What are the components of React Router v4?

Posted by Prem Tiwari | Updated on | ReactJS interview


What are the components of React Router v4? React Router v4 provides below 3 <Router> components: <BrowserRouter> <HashRouter> <MemoryRouter> The above components will create browser, hash, and memory history instances. React Router v4 makes the properties and methods of the history instance associated …

How to make AJAX call and in which component lifecycle methods should I make an AJAX call?

Posted by Prem Tiwari | Updated on | ReactJS interview


How to make AJAX call and in which component lifecycle methods should I make an AJAX call? You can use AJAX libraries such as Axios, jQuery AJAX, and the browser built-in fetch. You should fetch …