Created a Context API to switch between light mode and dark mode
React Material UI is a material design library built using React js that also supports Typescript.
Material UI has many UI components with working examples that make react developers life eaiser when they start integrating material UI components on their react projects.
One thing that I badly miss in React material UI is the support for the dark mode feature.
If you look at the material UI official documentation website, it has a toggle button to switch between light theme and dark theme.
include() method over
Array.prototype.includes() method was introduced in ECMAScript 2016 (ES7). This method is for determining whether a given element exists in an array or not. It returns
true if first occurrence of the element is found in the given array else returns
Array.prototype.indexOf() method returns the first index of the searched element present in an array, however
-1 is returned if the searched element is not found in the given array.
2 big problems you might encounter when using
indexOf() method to find an element in an array:
indexOfmethod does not say ‘what…
A Full Stack Web Developer