Function: useOrder
react-autonomyreact-autonomy.useOrder
â–¸ useOrder(props): UseOrderUseOrder
The useOrder hook returns the current loaded order.
This function has a side effect that will automatically start loading the subscription, if needed, upon initialization.

import { useOrder } from '@chordcommerce/react-autonomy'
export default () => {
const { order, isFetching } = useOrder({ orderNumber: PLANT-10000 })
if (isFetching) {
return (
<p>Loading…</p>
)
}
return (
<p>Current state of Order # {order.orderNumber} is {order.state}</p>
)
}Parameters
Name | Type | Description |
|---|---|---|
props | Object |  |
props.orderNumber | string | The order number of the order to load. |
Returns
UseOrderUseOrder