Skip to content

You recommend useMemoObservable in your documentation, what's the replacement in v3? #96

@tbassetto

Description

@tbassetto

Not really a bug bu I have code in my studio based on https://www.sanity.io/docs/studio-react-hooks#7a5503c777f4:

import {useMemoObservable} from 'react-rx'

export function MyComponent() {
  const docId = useFormValue(['_id'])
  const documentStore = useDocumentStore();
  const results = useMemoObservable(() => {
    return documentStore.listenQuery(
      `*[_type == 'article' && references($currentDoc) && !(_id in path("drafts.**"))]`,
      {currentDoc: docId},
      {}
    )
  }, [documentStore, docId])
  

	return (
	  /** Render component */
	)
}

Latest sanity comes with react-rx 3.0.0 which removes useMemoObersable but does not advice , any recommendation? The documentation should be updated too. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions