• RaspberryPi

    Raspbian empty space on left

    If you happen to see an empty space at the left of screen its most probably a panel you have added earlier. In order to remove it you need to right click and delete the panel. Once the panel is deleted you will see the space has gone and the screen will look like this

  • Gatsby

    Disable Source Maps in Gatsby

    Source maps are a great way to do debugging the minified/build version of the code. This often comes handy when we get a defect in production and wants to debug. Gatsby by default generate sourcemaps in build version. We can override this default behaviour and disable the generation of sourcemap (.map) files. For this we can use a Gatsby plugin called gatsby-plugin-no-sourcemaps Add the plugin gatsby-plugin-no-sourcemaps or use yarn command if you are using Yarn After installing this plugin you need to add the entry in Gatsby plugins array. Open gatsby-config.js and add the plugin name in plugins array. Your array will now look like below Now go to the…

  • Add component prop based on condition
    ReactJS

    Add component prop based on condition in ReactJS

    In this article we will discuss how to add or pass a component prop based on a condition. Lets have a component named MyButtonComponent that takes a prop name Now I need to pass this prop based on a flag called hasName of type Boolean We can do this using the spread operator What are we doing? We are using spread operator to spread the object {name: “some text”} or an empty object {} based on the value of our flag hasName. To check the condition we are using ternary operator. So the component have name prop or no prop named name Hope it helps, happy coding… 🍺