---
title: NerdletStateContext
source: https://docs.newrelic.com/docs/new-relic-solutions/build-nr-ui/sdk-component/platform-apis/NerdletStateContext
---

[React context](https://reactjs.org/docs/context.html#when-to-use-context) to access the nerdlet URL state.

### Usage

```jsx
import { NerdletStateContext } from 'nr1'
```

### Examples

#### Basic

```jsx
<NerdletStateContext.Consumer>
  {(nerdletState) => <pre>{JSON.stringify(nerdletState, null, 4)}</pre>}
</NerdletStateContext.Consumer>
```

### Methods

### `NerdletStateContext.subscribe`
