Posts

Showing posts from May, 2018

2018-05-09-importing-images

I always seem to have this recurring problem getting images into react components whose sole purpose is to handle images. Problem You can import an image from a local source easy enough, but I want to pass a reference to the image in as a prop, and props aren’t available outside the class. I can require() an image url within class easily enough, but this function only seems to accept literal URLs, not props.sourcePath (or whatever I’ve called it). And then I get confused passing this stuff through to styled-components . It feels marginally less complicated to use an <img /> tag since the src can sit right on there and can be accessed more easily by whatever approach I’m taking. When I want to use an image as background-image on a styled.div… man, I’m lost. You can find stuff about this online, but it’s not as straightforward to find and adapt a solution to this as it seems to be with most things I get stuck on. (current) Solution After my latest round of trial and er

vim

vim Vim :bufdo - do to all buffers eg :bufdo e! to update after a $ git pull reload with update

vim

`:bufdo e!` reload all tabs after `$ git pull`