Skip to content

Commit 4475d6e

Browse files
Copilothotlong
andcommitted
refactor: remove unnecessary nullish coalescing from static imports per code review
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/ddd5b726-e679-4ec8-9470-97f3ce913771
1 parent 6f300df commit 4475d6e

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

packages/plugin-view/src/ObjectView.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,8 @@ import { ViewSwitcher } from './ViewSwitcher';
6262

6363
/**
6464
* SchemaRenderer from @object-ui/react, used to render sub-view schemas.
65-
* Falls back to null if not available.
6665
*/
67-
const SchemaRendererComponent: React.FC<any> | null = ImportedSchemaRenderer ?? null;
66+
const SchemaRendererComponent: React.FC<any> = ImportedSchemaRenderer;
6867

6968
export interface ObjectViewProps {
7069
/**

packages/plugin-view/src/index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ export type { SharedViewLinkProps } from './SharedViewLink';
2727
/**
2828
* SchemaRendererContext is created by @object-ui/react.
2929
* The context value provides { dataSource }.
30-
* A fallback context is used when the imported context is unavailable.
3130
*/
32-
const FallbackContext = React.createContext<any>(null);
33-
const SchemaRendererContext: React.Context<any> = ImportedSchemaRendererContext ?? FallbackContext;
31+
const SchemaRendererContext: React.Context<any> = ImportedSchemaRendererContext;
3432

3533
// Register object-view component
3634
const ObjectViewRenderer: React.FC<{ schema: any }> = ({ schema }) => {

0 commit comments

Comments
 (0)