FunctionuseWebViewScrollGroupScrRef

A React hook for working with this web view's scroll group and Scripture Reference. Returns a value and a function to set the value for both the ScriptureReference and the ScrollGroupId with which this web view is synced (using this web view's scrollGroupScrRef property). Use similarly to useState.

Only used in WebView iframes. Please use useScrollGroupScrRef outside of WebViews.

@returns [scrRef, setScrRef, scrollGroupId, setScrollGroupId]

  • scrRef: The current value for the Scripture reference this web view is on
  • setScrRef: Function to use to update the Scripture reference this web view is on. If it is synced to a scroll group, sets the scroll group's Scripture reference
  • scrollGroupId: The current value for the scroll group this web view is synced with. If not synced to a scroll group, this is undefined
  • setScrollGroupId: Function to use to update the scroll group with which this web view is synced

@example

const [scrRef, setScrRef, scrollGroupId, setScrollGroupId] = useWebViewScrollGroupScrRef();
  • Returns [scrRef: ScriptureReference, setScrRef: ((newScrRef: ScriptureReference) => void), scrollGroupId: number, setScrollGroupId: ((newScrollGroupId: undefined | number) => void)]