react-pdf-viewer v2.3.0 Release Notes
-
๐ New features
- ๐ New
highlight
plugin provides the ability of selecting and adding notes for text in the document - 0๏ธโฃ The
default-layout
plugin allows to customize the tabs:
// `defaultTabs` is the list of default tabs which lists thumbnails, bookmarks and attachments respetively const defaultLayoutPluginInstance = defaultLayoutPlugin({ sidebarTabs: defaultTabs => { ... } });
We also can activate a given tab:
const { activateTab } = defaultLayoutPluginInstance; // Activate a tab // activateTab(index);
๐ฅ Breaking changes
- ๐ The
getPagesRef
method in plugins are changed togetPagesContainer
:
// Before interface PluginFunctions { getPagesRef(): React.RefObject<HTMLDivElement>; } // After interface PluginFunctions { getPagesContainer(): HTMLElement; }
- ๐ The
authorization
option is removed. You can use newwithCredentials
option:
// Before v2.3.0 <Viewer fileUrl={...} authorization='Bearer ...' /> // From v2.3.0 <Viewer fileUrl={...} withCredentials={true} httpHeaders={{ 'Authorization': 'Bearer ...', }} />
- ๐ New