When you click and page reloads…

when you have a button on a page that, when you click, reloads the page and you don’t know why, it maybe that your button is within the form tag and defaults the type to submit. Make sure your button has a type specified as a button to solve that.

{/* some code */}
  <MyButton>My Button</MyButton>
{/* some code */}
import React from 'react';

const MyButton = () => <button type="button">{children}</button>
export default MyButton;

A Series of Unfortunate Events – Snatched “M” from “GRELADESIGN.COM”

I’ve been busy and so I’ve left unattended my website for quite a long time. In the result I’ve missed email notification about domain renewal 🙁 and when I’ve found out it was too late, some Chinese guy snatched my domain planting ridiculous number of adverts on it. I’m trying to reclaim it but in the meantime my domain is greladesign.com but without “m” 🙂 greladesign.co

Mocking the CSS webpack imports using identity-obj-proxy

I’m sure at some point you have encountered the SyntaxError: Unexpected token . error when preparing tests with Jest, it pointed at the dot of the CSS class name.

({“Object.“:function(module,exports,require,__dirname,__filename,global,jest){.my-class {
SyntaxError: Unexpected token .

If you are familiar with it then probably you have resolved it and probably already are using the identity-obj-proxy dependency in your project. For those who are searching for a solution please read on.
Continue reading