key
is pretty much crucial for state perservation in React. As of React 0.13 it can't do the following things:
- Clone state
<Comp key={1} /><Comp key={1} />
- Preserve component state across different parents:
import React from 'react' | |
import warning from 'warning' | |
const { number, object } = React.PropTypes | |
const WindowScrollTo = React.createClass({ | |
contextTypes: { | |
windowScrollTo: object | |
}, |
key
is pretty much crucial for state perservation in React. As of React 0.13 it can't do the following things:
<Comp key={1} /><Comp key={1} />
(ns fsm | |
(:refer-clojure :exclude [==]) | |
(:use [clojure.core.logic])) | |
;; Encoding a Finite State Machine and recognizing strings in its language in Clojure core.logic | |
;; We will encode the following FSM: | |
;; | |
;; (ok) --+---b---> (fail) | |
;; ^ | |
window.addEventListener "DOMContentLoaded", -> | |
body = $ "body" | |
canvas = $ "#canvas" | |
chalkboard = $ "#chalkboard" | |
close = $ "#close" | |
ledge = $ "#ledge" | |
lightswitch = $ "#lightswitch" | |
output = $ "#output" | |
shade = $ "#shade" | |
share = $ "#share" |