Posts

Showing posts from 2022

Fixed: Compiled error: export 'Switch' (imported as 'Switch') was not found in 'react-router-dom' in reactJs

 In React " react-router-dom" v6 , " Switch " is replaced by routes " Routes ".  So, you need to update the import from import { Switch, Route } from "react-router-dom"; to  import { Routes, Route } from 'react-router-dom';

CONCAT returns NULL if any one field contain NULL value in MySQL: Solved

As per MySQL documentation CONCAT() returns NULL if any argument is NULL. So, we need to use  CONCAT   with   IFNULL . For Example SELECT    CONCAT( IFNULL(`contact_name`, ''),' ',IFNULL(`last_name`, '')) AS full_name FROM `users`

Apexcharts not re-render after ajax call - Solved

  render() method just once in the beginning even with empty array, then call the updateSeries() method in ajax call to update data of the chart. var options = { series: [{   name: 'Completed trips',   data: [] }, {   name: 'Cancelled trips',   data: [] }], chart: {   height: 350,   type: 'bar',   toolbar: { show: false },   zoom: { enabled: false } }, plotOptions: {   bar: { horizontal: false, columnWidth: '55%', endingShape: 'rounded'   }, }, dataLabels: { enabled: false }, stroke: {   show: true,   width: 2,   colors: ['transparent'] }, fill: { colors: ['#ffc074', '#6e6e6e'] }, markers: { colors:  ['#ffc074', '#6e6e6e'] }, legend: {   markers: { fillColors: ['#ffc074', '#6e6e6e'] } }, noData: { text: 'Loading...'}, xaxis: {   categories: ['Jan','Feb', 'Mar', 'Apr', 'May'