mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-30 15:00:09 +02:00
chore: add cSpell for spell checking (#6456)
* chore: Add cSpell for spell checking * chore: exclude map files and remove dups * chore: exclude more binary files * chore: remove MD headings * Update .cspell.json * fix a few spellings * fix more * fix Signed-off-by: Joshua Chen <sidachen2003@gmail.com> * fix a few * oops Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
This commit is contained in:
parent
a41a5c328c
commit
521eb119a7
64 changed files with 852 additions and 142 deletions
|
@ -151,7 +151,7 @@ type CollapsibleElementType = React.ElementType<
|
|||
Pick<React.HTMLAttributes<unknown>, 'className' | 'onTransitionEnd' | 'style'>
|
||||
>;
|
||||
|
||||
// Prevent hydration layout shift before anims are handled imperatively with JS
|
||||
// Prevent hydration layout shift before animations are handled imperatively with JS
|
||||
function getSSRStyle(collapsed: boolean) {
|
||||
if (ExecutionEnvironment.canUseDOM) {
|
||||
return undefined;
|
||||
|
|
|
@ -43,7 +43,7 @@ const useAnnouncementBarContextValue = (): AnnouncementBarAPI => {
|
|||
|
||||
const [isClosed, setClosed] = useState(() =>
|
||||
isBrowser
|
||||
? // On client navigation: init with localstorage value
|
||||
? // On client navigation: init with local storage value
|
||||
isDismissedInStorage()
|
||||
: // On server/hydration: always visible to prevent layout shifts (will be hidden with css if needed)
|
||||
false,
|
||||
|
@ -68,6 +68,7 @@ const useAnnouncementBarContextValue = (): AnnouncementBarAPI => {
|
|||
|
||||
// retrocompatibility due to spelling mistake of default id
|
||||
// see https://github.com/facebook/docusaurus/issues/3338
|
||||
// cSpell:ignore annoucement
|
||||
if (viewedId === 'annoucement-bar') {
|
||||
viewedId = 'announcement-bar';
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ type DocsPreferredVersionState = Record<
|
|||
DocsPreferredVersionPluginState
|
||||
>;
|
||||
|
||||
// Initial state is always null as we can't read localstorage from node SSR
|
||||
// Initial state is always null as we can't read local storage from node SSR
|
||||
function getInitialState(pluginIds: string[]): DocsPreferredVersionState {
|
||||
const initialState: DocsPreferredVersionState = {};
|
||||
pluginIds.forEach((pluginId) => {
|
||||
|
|
|
@ -104,7 +104,7 @@ export function MobileSecondaryMenuFiller<
|
|||
const memoizedProps = useShallowMemoizedObject(props);
|
||||
|
||||
useEffect(() => {
|
||||
// @ts-expect-error: context is not 100% typesafe but it's ok
|
||||
// @ts-expect-error: context is not 100% type-safe but it's ok
|
||||
setState({component, props: memoizedProps});
|
||||
}, [setState, component, memoizedProps]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue