Akash Rajput Technology over a cup of coffee

Part 12: Working with state

30 sec read

Featured Video Play Icon

Understand State

  • Now components has a built-in state object
  • The state object is where you store property values that belongs to the page or component
  • When the state object changes, the component re-renders.
  • To change the state of the property, use setState method. Never use this.state metthod.
  • Read more about State HERE

Navigate to Catalog Success Page

  • From UI Builder, Goto Catalog Success Page
  • Goto the same pane where we created Client script from the left side of the navigation
  • There is one more option that says Client State just above the Client Scripts
  • Let’s create 2 State props. One to hold created request number and one are to hold the request sys_id. Click + Add.
    • requestNumber – String
    • requestSysId – String
  • Click Save on the top to save the page

Great!! We have successfully created a state on the Catalog Success page to hold the sysId, number.

Akash Rajput Technology over a cup of coffee

Leave a Reply

Your email address will not be published. Required fields are marked *

Never miss a story from me, get updates directly in your inbox.
Loading