React Snippets
DEPRECATED. USE "REACT-HELPFUL" INSTEAD
Reference
Empty
Empty script component with comments
<Empty comment="empty component comment"/>
rendered as
If
Case component rendering with arguments and comment by render callback
<Switch value=valueprops=myPropscase=value1: MyComponent{return <MyAnotherComponent ...props />}def=DefaultComponentcomment="switch case"/>
Switch
Condition component rendering with arguments and comment by render callback
<If is=conditionprops=myPropsrender= <Component prop=myProps />elseRender= <AnotherComponent prop=myProps />comment="if condition"/>
or just a Component
<If is=conditionprops=myPropsrender=ComponentelseRender=AnotherComponentcomment="if condition"/>
EventListener
Capturing event globally
<EventListenerevent="click"on=thisonClick/>
or by selector
<ElementEventListenertarget="#target"event="click"on=thisonClick/>
Await
Await promise complete, if component will be unmounted it trigger onCancel
{;}// ...<AwaitrenderComplete= <div>Complete</div>renderPending= <div>Pending</div>onStart= thisonStartonSuccess= thisonSuccessonError= thisonErroronCancel= thisonCancel/>
Sequencer
Sequenced promised functions execution
<Sequenceractions=configLoadAction configDependedDataLoadrenderComplete= <div>Complete</div>renderPending= <div>Pending</div>onStart= thisonStartonSuccess= thisonSuccessonError= thisonErroronCancel= thisonCancel/>
Composer
Parallel promised functions execution
<Composeractions=friendsLoadAction messagesLoadActionrenderComplete= <div>Complete</div>renderPending= <div>Pending</div>onStart= thisonStartonSuccess= thisonSuccessonError= thisonErroronCancel= thisonCancel/>
Request
Request rendering component
<Requesturl=requestUrlquery=queryObjectmethod="POST"headers=headersdata=data// Basic Authenticationusername=usernamepassword=passwordonStart=thisonStartonProgress=thisonProgressonSuccess=thisonSuccessonError=thisonErroronCancel=thisonCancelrenderComplete=thisrenderOnCompleterenderPending=thisrenderOnPending/>
License
The MIT License Copyright (c) 2016 Ivan Zakharchenko