Upload
deepakpatil84
View
56
Download
4
Tags:
Embed Size (px)
Citation preview
Angular Vs React
Angular React
ControllerDirectiveServiceFactoryProviderModule.config.runbootstrap
Component
Virtual DOMReact.createElement(‘div’) - type,props,ref,keyrefsReact.findDOMNode
e.g. React.findDOMNode(this.refs.myinput).focus()
React Component Methods
render()
getInitialState()
getDefaultProps()
propTypes:{}
mixins:[]
statics:{}
componentWillMount()
componentDidMount()
componentWillRecieveProps()
shouldComponentUpdate()
componentWillUpdate()
componentDidUpdate()
componentWillUnmount()
Form<input>,<textarea>,<option>,<select>Controlled vs Uncontrolledinput[type=text|password|date|email],textarea,select : valueinput[type=checkbox|radio]:checkedoption:selected
Validation .. ?
Event SystemSyntheticEvent <wrapper>nativeEvent</wrapper>onClick,onChange,onInputonTouchStart,onTouchEndonFocus,onBluronKeyDown,onKeyPress
Few more thingspropTypesrefs ( referencing dom elements)React.renderReact.createElementReact.DOM.[div,ul,...]this.props.children(like angular transclude)React.addonstwo-way bindingPerformance Tools