How to refresh SPFX webpart

%3CLINGO-SUB%20id%3D%22lingo-sub-59571%22%20slang%3D%22en-US%22%3EHow%20to%20refresh%20SPFX%20webpart%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-59571%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EI%20am%20developing%20webpart%20with%20new%20SharePoint%20Framework.%20I%20notice%20when%20user%20changed%20any%20value%20in%20property%20it%20refresh%2Freload%20the%20webpart.%20I%20want%20to%20refresh%2Freload%20the%20web%20part%20when%20user%20click%20on%20a%20button%20on%20the%20webpart.%20I%20did%20not%20find%20any%20solutionhow%20to%20do%20this.%20Please%20share%20ideas%20if%20anybody%20have.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-301692%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20refresh%20SPFX%20webpart%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-301692%22%20slang%3D%22en-US%22%3E%3CP%3EDid%20you%20get%20this%20resolved%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CBLOCKQUOTE%3E%3CHR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F46936%22%20target%3D%22_blank%22%3E%40Samaresh%20Das%3C%2FA%3E%26nbsp%3Bwrote%3A%3CBR%20%2F%3EHi%20Paul%2C%3CBR%20%2F%3EI%20have%20tried%20this%20but%20it%20says%20Render%20function%20undefine.%26nbsp%3B%3C%2FBLOCKQUOTE%3E%0A%3CP%3EIt%20appears%20%3CSTRONG%3Ethis%3C%2FSTRONG%3E%20doesn't%20have%20the%20proper%20reference.%20By%20chance%20are%20you%20calling%20it%20from%20within%20an%20event%20handler%3F%20If%20so%2C%20the%20challenge%20is%20that%20%3CSTRONG%3Ethis%3C%2FSTRONG%3E%20within%20the%20handler%20(such%20as%20clicking%20a%20button)%20is%20tied%20to%20the%20thing%20that%20triggered%20the%20event...%20in%20this%20case%20a%20button.%20You%20want%20to%20bind%20the%20event%20handler%20function%20to%20the%20web%20part%20itself.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAssuming%20you%20have%20something%20like%3A%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%26lt%3Bbutton%20onClick%3D%22this._buttonClickHandler%22%26gt%3B%26lt%3B%2Fbutton%26gt%3B%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20fix%20that%20by%20changing%20your%20function%20declaration%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3Eprivate%20_buttonClickHandler%20%3D%20()%3A%20void%20%3D%26gt%3B%20%7B%0A%20%20this.render()%3B%0A%7D%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-179874%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20refresh%20SPFX%20webpart%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-179874%22%20slang%3D%22en-US%22%3E%3CP%3E%3C!--%20%3Clink%20rel%3D%22stylesheet%22%20type%3D%22text%2Fcss%22%20href%3D%22%2Fhtml%2Fassets%2FContent%2Fpicchu2.css%22%20%2F%3E%20--%3E%3C!--%20%20%5BBegin%5D%20%20JSLL%20%20script%20%20includes%20%20--%3E%3C!--%20%5BEnd%5D%20JSLL%20script%20includes%20--%3E%3C!--%20Facebook%20Pixel%20Code%20--%3E%3C!--%20DO%20NOT%20MODIFY%20--%3E%3C!--%20End%20Facebook%20Pixel%20Code%20--%3EWere%20you%20able%20to%20get%20the%20answer%20to%20your%20Original%20question%20%3F%3C%2FP%3E%0A%3CDIV%20class%3D%22lia-page%22%3E%3CCENTER%3E%0A%3CDIV%20class%3D%22MinimumWidthContainer%22%3E%0A%3CDIV%20class%3D%22min-width-wrapper%22%3E%0A%3CDIV%20class%3D%22min-width%22%3E%0A%3CDIV%20class%3D%22lia-content%22%3E%0A%3CDIV%20class%3D%22lia-quilt%20lia-quilt-forum-topic-page%20lia-quilt-layout-two-column-main-side%20lia-top-quilt%22%3E%0A%3CDIV%20class%3D%22lia-quilt-row%20lia-quilt-row-main%22%3E%0A%3CDIV%20class%3D%22lia-quilt-column%20lia-quilt-column-16%20lia-quilt-column-left%20lia-quilt-column-main-content%22%3E%0A%3CDIV%20class%3D%22lia-quilt-column-alley%20lia-quilt-column-alley-left%22%3E%0A%3CDIV%20class%3D%22lia-component-topic-message%22%3E%0A%3CDIV%20class%3D%22linear-message-list%20message-list%22%3E%0A%3CDIV%20class%3D%22lia-linear-display-message-view%22%20id%3D%22lineardisplaymessageviewwrapper%22%3E%0A%3CDIV%20class%3D%22first-message%22%3E%0A%3CDIV%20class%3D%22lia-panel-message%20message-uid-59571%22%20id%3D%22messageview%22%20data-lia-message-uid%3D%2259571%22%3E%0A%3CDIV%20class%3D%22lia-message-view-wrapper%20lia-js-data-messageUid-59571%20lia-component-forums-widget-message-view-two%22%20id%3D%22messageView2_1%22%20data-lia-message-uid%3D%2259571%22%3E%0A%3CDIV%20class%3D%22MessageView%20lia-message-view-forum-message%20lia-message-view-display%20lia-row-standard-unread%20lia-thread-topic%20unread%22%3E%0A%3CDIV%20class%3D%22lia-quilt%20lia-quilt-forum-message%20lia-quilt-layout-two-column-message%22%3E%0A%3CDIV%20class%3D%22lia-quilt-row%20lia-quilt-row-main%22%3E%0A%3CDIV%20class%3D%22lia-quilt-column%20lia-quilt-column-18%20lia-quilt-column-left%20lia-quilt-column-main-left%22%3E%0A%3CDIV%20class%3D%22lia-quilt-column-alley%20lia-quilt-column-alley-left%22%3E%0A%3CDIV%20class%3D%22lia-message-body%20lia-component-body-signature-highlight-escalation%22%20id%3D%22messageBodySimpleDisplay%22%3E%0A%3CDIV%20class%3D%22lia-message-body-content%22%3E%0A%3CP%3E%3CSPAN%3EI%20want%20to%20refresh%2Freload%20the%20web%20part%20when%20user%20click%20on%20a%20button%20on%20the%20webpart%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FCENTER%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-59975%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20refresh%20SPFX%20webpart%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-59975%22%20slang%3D%22en-US%22%3EHi%20Paul%2C%3CBR%20%2F%3EI%20have%20tried%20this%20but%20it%20says%20Render%20function%20undefine.%20Gulp%20serve%20command%20bundle%20all%20type%20script%20in%20its%20own%20way.%20For%20this%20reason%20i%20wanted%20something%20from%20framwork%20so%20that%20i%20can%20invoke%20this%20method%20in%20proper%20channel.%20But%20I%20am%20able%20to%20change%20the%20DOM%20without%20refresh%20the%20webpart.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-59929%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20refresh%20SPFX%20webpart%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-59929%22%20slang%3D%22en-US%22%3E%3CP%3EEach%20SPFx%20Web%20Part%20implements%20a%20%22Render%22%20function.%20Couldn't%20you%20just%20call%20this%20Render()%20function%26nbsp%3Bfrom%20your%20event%20handler%20to%20perform%20the%20refresh%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-59924%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20refresh%20SPFX%20webpart%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-59924%22%20slang%3D%22en-US%22%3EHi%20Luis%2C%3CBR%20%2F%3EI%20am%20not%20using%20any%20javascript%20framwork.%20I%20am%20able%20to%20manage%20the%20change%20DOM.%20But%20it%20would%20nice%20if%20framwork%20expose%20any%20interface%20to%20refresh%20the%20webpart%20programatically.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-59923%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20refresh%20SPFX%20webpart%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-59923%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Paul%2C%3CBR%20%2F%3EIn%20my%20post%20i%20raised%20the%20property%20as%20example%20it%20is%20not%20my%20target.%20My%20target%20is%20refresh%20the%20webpart%20progmatically%20when%20user%20click%20on%20the%20button.%20The%20button%20will%20be%20render%20in%20initial%20loading.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-59868%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20refresh%20SPFX%20webpart%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-59868%22%20slang%3D%22en-US%22%3E%3CP%3ESo%20what%20you%20want%20to%20achieve%20is%20to%20update%20a%20property%20through%20the%20rendered%20Web%20Part%20instead%20of%20through%20its%20Property%20Pane%20and%20refresh%20the%20Web%20Part%20after%20update%20to%20reflect%20the%20property%20change%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-59862%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20refresh%20SPFX%20webpart%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-59862%22%20slang%3D%22en-US%22%3E%3CP%3EI%20don't%20think%20there's%20a%20specific%20method%20to%20refresh%20the%20webpart%20itself.%20Are%20you%20using%20ReactJS%20in%20the%20webpart%3F%20in%20that%20case%2C%20if%20you%20follow%20ReactJS%20component%20lifecycle%2C%20the%20component%20re-renders%20when%20the%20state%20is%20updated.%20If%20you%20are%20using%20just%20JavaScript%2C%20and%20you%20say%20you're%20able%20to%20catch%20the%20event%2C%20then%20you%20need%20to%20refresh%20the%20DOM%20setting%20the%20new%20values.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-59662%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20refresh%20SPFX%20webpart%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-59662%22%20slang%3D%22en-US%22%3EI%20am%20able%20to%20fire%20the%20click%20event%20and%20execute%20my%20custom%20code.%20Here%20need%20to%20fire%20a%20sharepoint%20framework%20method%20to%20refresh%20the%20webpart%2C%20so%20i%20need%20the%20sample%20code%20of%20SPFX%20webpart%20refresh%20method.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-59608%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20refresh%20SPFX%20webpart%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-59608%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20sorry%20I%20misunderstood...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegarding%20your%20question%20then%20I%20think%20it%20all%20comes%20down%20to%20attaching%20an%20event%20handler%20to%20the%20button's%20click%20event%2C%20perform%20whatever%20logic%20needed%20to%20refresh%20and%20ultimately%20making%20sure%20your%20HTML%20is%20updated.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMaybe%20the%20information%20in%20the%20following%20article%20helps%20you%20out%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.w3schools.com%2Fjsref%2Fevent_onclick.asp%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.w3schools.com%2Fjsref%2Fevent_onclick.asp%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20this%20helps!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-59602%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20refresh%20SPFX%20webpart%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-59602%22%20slang%3D%22en-US%22%3EThanks%20for%20your%20reply%20but%20sorry%20to%20say%20you%20miss%20understand%20me.%20My%20objective%2C%20there%20will%20be%20a%20button%20in%20web%20part%20not%20in%20property%20pane.%20When%20user%20will%20click%20on%20the%20button%20from%20webpart%20it%20will%20refresh%20the%20webpart.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-59573%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20refresh%20SPFX%20webpart%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-59573%22%20slang%3D%22en-US%22%3E%3CP%3EI%20think%20wat%20you're%20looking%20for%20is%20described%20in%20this%20great%20blog%20by%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F121%22%20target%3D%22_blank%22%3E%40Waldek%20Mastykarz%3C%2FA%3E%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fblog.mastykarz.nl%2Fsharepoint-framework-client-side-web-parts-non-reactive-property-pane%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fblog.mastykarz.nl%2Fsharepoint-framework-client-side-web-parts-non-reactive-property-pane%2F%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1151001%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20refresh%20SPFX%20webpart%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1151001%22%20slang%3D%22en-US%22%3E%3CPRE%3Ecomponent%3CSPAN%20class%3D%22token%20punctuation%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22token%20function%22%3EforceUpdate%3C%2FSPAN%3E%3CSPAN%20class%3D%22token%20punctuation%22%3E(%3C%2FSPAN%3Ecallback%3CSPAN%20class%3D%22token%20punctuation%22%3E)%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3EBy%20default%2C%20when%20your%20component%E2%80%99s%20state%20or%20props%20change%2C%20your%20component%20will%20re-render.%20If%20your%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Erender()%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Emethod%20depends%20on%20some%20other%20data%2C%20you%20can%20tell%20React%20that%20the%20component%20needs%20re-rendering%20by%20calling%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3EforceUpdate().%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECalling%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3EforceUpdate()%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ewill%20cause%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Erender()%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eto%20be%20called%20on%20the%20component%2C%20skipping%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3EshouldComponentUpdate().%20This%20will%20trigger%20the%20normal%20lifecycle%20methods%20for%20child%20components%2C%20including%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3EshouldComponentUpdate()%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Emethod%20of%20each%20child.%20React%20will%20still%20only%20update%20the%20DOM%20if%20the%20markup%20changes.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENormally%20you%20should%20try%20to%20avoid%20all%20uses%20of%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3EforceUpdate()%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eand%20only%20read%20from%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ethis.props%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eand%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ethis.state%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ein%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Erender().%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F46936%22%20target%3D%22_blank%22%3E%40Samaresh%20Das%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

I am developing webpart with new SharePoint Framework. I notice when user changed any value in property it refresh/reload the webpart. I want to refresh/reload the web part when user click on a button on the webpart. I did not find any solutionhow to do this. Please share ideas if anybody have.

13 Replies
Highlighted
Highlighted
Thanks for your reply but sorry to say you miss understand me. My objective, there will be a button in web part not in property pane. When user will click on the button from webpart it will refresh the webpart.
Highlighted

I'm sorry I misunderstood...

 

Regarding your question then I think it all comes down to attaching an event handler to the button's click event, perform whatever logic needed to refresh and ultimately making sure your HTML is updated. 

 

Maybe the information in the following article helps you out

https://www.w3schools.com/jsref/event_onclick.asp

 

Hope this helps!

 

Highlighted
I am able to fire the click event and execute my custom code. Here need to fire a sharepoint framework method to refresh the webpart, so i need the sample code of SPFX webpart refresh method.
Highlighted

I don't think there's a specific method to refresh the webpart itself. Are you using ReactJS in the webpart? in that case, if you follow ReactJS component lifecycle, the component re-renders when the state is updated. If you are using just JavaScript, and you say you're able to catch the event, then you need to refresh the DOM setting the new values.

Highlighted

So what you want to achieve is to update a property through the rendered Web Part instead of through its Property Pane and refresh the Web Part after update to reflect the property change? 

Highlighted

Hi Paul,
In my post i raised the property as example it is not my target. My target is refresh the webpart progmatically when user click on the button. The button will be render in initial loading.

Highlighted
Hi Luis,
I am not using any javascript framwork. I am able to manage the change DOM. But it would nice if framwork expose any interface to refresh the webpart programatically.
Highlighted

Each SPFx Web Part implements a "Render" function. Couldn't you just call this Render() function from your event handler to perform the refresh?

Highlighted
Hi Paul,
I have tried this but it says Render function undefine. Gulp serve command bundle all type script in its own way. For this reason i wanted something from framwork so that i can invoke this method in proper channel. But I am able to change the DOM without refresh the webpart.
Highlighted

Were you able to get the answer to your Original question ?

I want to refresh/reload the web part when user click on a button on the webpart

Highlighted

Did you get this resolved?

 


@Samaresh Das wrote:
Hi Paul,
I have tried this but it says Render function undefine. 

It appears this doesn't have the proper reference. By chance are you calling it from within an event handler? If so, the challenge is that this within the handler (such as clicking a button) is tied to the thing that triggered the event... in this case a button. You want to bind the event handler function to the web part itself.

 

Assuming you have something like: 

 

<button onClick="this._buttonClickHandler"></button>

 

You can fix that by changing your function declaration:

 

private _buttonClickHandler = (): void => {
  this.render();
}
Highlighted
component.forceUpdate(callback)

By default, when your component’s state or props change, your component will re-render. If your render() method depends on some other data, you can tell React that the component needs re-rendering by calling forceUpdate().

 

Calling forceUpdate() will cause render() to be called on the component, skipping shouldComponentUpdate(). This will trigger the normal lifecycle methods for child components, including the shouldComponentUpdate() method of each child. React will still only update the DOM if the markup changes.

 

Normally you should try to avoid all uses of forceUpdate() and only read from this.props and this.state in render().

 

 

@Samaresh Das