Fix react warning, fix dom issues

This commit is contained in:
Daniel Lautzenheiser 2023-04-06 16:19:36 -04:00
parent 4264218439
commit 2469b8bbfe
5 changed files with 32 additions and 15 deletions

View File

@ -31,6 +31,20 @@ import './styles/main.css';
const ROOT_ID = 'nc-root'; const ROOT_ID = 'nc-root';
/**
* Very hacky. This suppresses the "You are importing createRoot from "react-dom" which
* is not supported. You should instead import it from "react-dom/client"." warning.
*
* Not sure why this is necessary as we import from "react-dom/client" as we should.
*/
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// eslint-disable-next-line @typescript-eslint/no-unused-vars, import/order
import ReactDOM from 'react-dom';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = true;
const TranslatedApp = ({ locale, config }: AppRootProps) => { const TranslatedApp = ({ locale, config }: AppRootProps) => {
if (!config) { if (!config) {
return null; return null;

View File

@ -122,10 +122,14 @@ const EntryListing = ({
if (viewStyle === 'VIEW_STYLE_LIST') { if (viewStyle === 'VIEW_STYLE_LIST') {
return ( return (
<Table columns={!isSingleCollectionInList ? ['Collection', ...summaryFields] : summaryFields}> <>
<Table
columns={!isSingleCollectionInList ? ['Collection', ...summaryFields] : summaryFields}
>
{renderedCards} {renderedCards}
{hasMore && handleLoadMore && <Waypoint key={page} onEnter={handleLoadMore} />}
</Table> </Table>
{hasMore && handleLoadMore && <Waypoint key={page} onEnter={handleLoadMore} />}
</>
); );
} }

View File

@ -40,13 +40,12 @@ const Sidebar: FC<TranslateProps> = ({ t }) => {
if ('nested' in collection) { if ('nested' in collection) {
return ( return (
<li key={`nested-${collectionName}`}>
<NestedCollection <NestedCollection
key={`nested-${collectionName}`}
collection={collection} collection={collection}
filterTerm={filterTerm} filterTerm={filterTerm}
data-testid={collectionName} data-testid={collectionName}
/> />
</li>
); );
} }

View File

@ -78,7 +78,7 @@ import type {
TText, TText,
WithOverride, WithOverride,
} from '@udecode/plate'; } from '@udecode/plate';
import type { CSSProperties } from 'styled-components'; import type { CSSProperties } from 'react';
export const ELEMENT_SHORTCODE = 'shortcode' as const; export const ELEMENT_SHORTCODE = 'shortcode' as const;

View File

@ -6155,14 +6155,14 @@ babel-plugin-react-svg@^3.0.3:
integrity sha512-Pst1RWjUIiV0Ykv1ODSeceCBsFOP2Y4dusjq7/XkjuzJdvS9CjpkPMUIoO4MLlvp5PiLCeMlsOC7faEUA0gm3Q== integrity sha512-Pst1RWjUIiV0Ykv1ODSeceCBsFOP2Y4dusjq7/XkjuzJdvS9CjpkPMUIoO4MLlvp5PiLCeMlsOC7faEUA0gm3Q==
"babel-plugin-styled-components@>= 1.12.0": "babel-plugin-styled-components@>= 1.12.0":
version "2.0.7" version "2.1.1"
resolved "https://registry.yarnpkg.com/babel-plugin-styled-components/-/babel-plugin-styled-components-2.0.7.tgz#c81ef34b713f9da2b7d3f5550df0d1e19e798086" resolved "https://registry.yarnpkg.com/babel-plugin-styled-components/-/babel-plugin-styled-components-2.1.1.tgz#cd977cc0ff8410d5cbfdd142e42576e9c8794b87"
integrity sha512-i7YhvPgVqRKfoQ66toiZ06jPNA3p6ierpfUuEWxNF+fV27Uv5gxBkf8KZLHUCc1nFA9j6+80pYoIpqCeyW3/bA== integrity sha512-c8lJlszObVQPguHkI+akXv8+Jgb9Ccujx0EetL7oIvwU100LxO6XAGe45qry37wUL40a5U9f23SYrivro2XKhA==
dependencies: dependencies:
"@babel/helper-annotate-as-pure" "^7.16.0" "@babel/helper-annotate-as-pure" "^7.16.0"
"@babel/helper-module-imports" "^7.16.0" "@babel/helper-module-imports" "^7.16.0"
babel-plugin-syntax-jsx "^6.18.0" babel-plugin-syntax-jsx "^6.18.0"
lodash "^4.17.11" lodash "^4.17.21"
picomatch "^2.3.0" picomatch "^2.3.0"
babel-plugin-syntax-export-extensions@^6.8.0: babel-plugin-syntax-export-extensions@^6.8.0: