2.1.0 • Published 2 years ago

react-reftagger v2.1.0

Weekly downloads
7
License
ISC
Repository
github
Last release
2 years ago

react-reftagger · npm

Utilize Faithlife RefTagger in sites built with React.

Installation

npm install react-reftagger

yarn add react-reftagger

pnpm i react-reftagger

Usage

Import RefTagger for use

import { RefTagger } from 'react-reftagger';

Use RefTagger as a component and provide the configuration options as props. Configuration options can be found in the type declaration file or on the RefTagger customization page.

<RefTagger bibleVersion={'ESV'} />;

Advanced Usage

You can have RefTagger run on only part of your DOM via the rootNode configuration option.

const [rootNode, setRootNode] = useState(null as Node);
const setRef = useCallback((node: Node) => {
  setRootNode(node);
}, []);

return (
  <div>
    <div>{`Here's John 1:1.`}</div>
    <div ref={setRef}>{`Here's John 1:2.`}</div>
    {!rootNode ? null : <RefTagger bibleVersion={'ESV'} rootNode={rootNode} />}
  </div>
);
2.1.0

2 years ago

2.0.0

3 years ago

1.0.0

4 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago