- People over tools
- Sw over doc
- Collaboration over contract
- Change over plan
renderScene(route, navigator){ | |
return <route.component navigator={navigator} /> | |
} | |
render(){ | |
return( | |
<Navigator | |
initialRoute={{component: RamNavigation}} | |
renderScene={this.renderScene.bind(this)} /> | |
) |
Method | Side effects1 | State updates2 | Example uses |
---|---|---|---|
Mounting | |||
componentWillMount |
✓ | Constructor equivalent for createClass |
|
render |
Create and return element(s) | ||
componentDidMount |
✓ | ✓ | DOM manipulations, network requests, etc. |
Updating | |||
componentWillReceiveProps |
✓ | Update state based on changed props |
Hi Nicholas,
I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:
The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't
require 'rails_helper' | |
RSpec.describe TodosController, :type => :controller do | |
describe "GET #index" do | |
#describe "POST #create" do | |
#describe "GET #show" do | |
#describe "PATCH #update" do (or PUT #update) | |
#describe "DELETE #destroy" do | |
#describe "GET #new" do |
This is a collection of information on PostgreSQL and PostGIS for what I tend to use most often.
# -*- coding: utf-8 -*- | |
# phases = %w{🌑 🌒 🌓 🌔 🌕 🌖 🌗 🌘} | |
phases = (0x1F311..0x1F318).to_a.collect{|c| [c].pack('U*')} | |
clear_line = "\r\e[0K" | |
1000.times do |i| | |
phase = phases[i % phases.size] | |
print "#{clear_line} #{phase}\t#{i} #{phase.unpack('U*').map{ |i| "\\u" + i.to_s(16).rjust(4, '0') }.join}" | |
sleep rand / 10.0 |
// See https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames for more details. | |
var degrees2meters = function(lon,lat) { | |
var x = lon * 20037508.34 / 180; | |
var y = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180); | |
y = y * 20037508.34 / 180; | |
return [x, y] | |
} | |
x= -77.035974 |