This one will be a short and sweet post. If there is a better way to do this, please let me know. I’m all ears. Simply add the following to the component that you want Code prettify to run for and you’re golden. componentDidMount() { this.runCodePrettify(); } runCodePrettify() { let script = document.createElement(‘script’); script.type = […]
Last night I had a huge ‘connect the dots’ moment. You know, that moment when you realize you were being a ‘doofus’. I thought I understood the concepts of ‘bind’ and ‘this’ in the context of JavaScript; at least a pretty basic understanding. I knew OOP was done differently in JavaScript than in Java or Python so I […]
When in the course of developing React/Redux apps, one may verily find him/herself wracking their brain for how to update many separate components in one simple, simultaneous function call. This was the case when one of our clients wanted a CONFIRM ALL button placed on their app. This gave rise to two questions of existential […]
I just discovered a very annoying bug that took me half an hour to figure out. Here’s what I discovered: NEVER define React components (even dumb stateless components) inside of the React render() method. I had an input field that would lose focus as soon as its value changed. So the userĀ could only enter one […]
This blog post is heavily inspired by this. It didn’t quite work for me so I made some modifications and figured I’d write a post about it. This tutorial assumes that you already have a standard Devise set up on a rails 4 environment. Install the ruby-jwt gem Add the following to your gem file: gem ‘jwt’, […]
I love using Devise on my Rails projects and love ReactJS but figuring out how to hook the two together was more complicated than I would have liked. So I figured I’d share my findings! Comments and criticisms are always welcome. To preface this post, it makes sense to describe my setup. I’m running a Rails […]
ReactJs is awesome and Ruby on Rails is awesome. Yes, I get that Ruby on Rails is a resource hog and there are much better choices for serving a ReactJs app on that front… but Rails development is fast and when my developers work on Rails projects, they’re productive. So we wanted to throw ReactJS […]