Month: February 2018

js adding div at runtime

Using JS to add div elements dynamically

February 20, 2018

Scenario:- Legacy code thrown at you with new UX design, and you cannot touch the original code. So doing latest UI changes is headache. Solution:- Play with the structure of the html and add latest flexbox or grid CSS to make your life hell easier. How i did re-structuring was appending new parent div, which […]

Read More

How to debug jest test cases(React)?

February 13, 2018

Adding test cases to your code always helps in the long run, today we’re going to talk about how to debug test cases. Do something today that your future self will thank you for Using our all time favourite Console.log it(‘should call touch & asyncValidate methods’, () => { const component = shallow( <TrialRegistrationForm handleSubmit={mockHandleSubmit} […]

Read More

Console.log trick for debugging

February 2, 2018

Why need see our debug messages bigger and brighter, simply use the below trick. console.log(‘%c This is my log for debugging’, ‘font-size: 40px; color: green;’); “Striving for excellence motivates you; striving for perfection is demoralizing.”  

Read More