Sanity Library Reference Docs
    Preparing search index...

    Function useDataset

    • React hook that returns the name of the current dataset

      Returns string

      The name of the current dataset

      function MyComponent() {
      const dataset = useDataset()
      // ... do something with the dataset name ...
      }