Skip to content

Commit bd0ca5b

Browse files
authored
Fix @gitbook/react-openapi when react import are mandatory (#2389)
1 parent f6bacea commit bd0ca5b

13 files changed

+19
-11
lines changed

.changeset/funny-emus-promise.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@gitbook/react-openapi': minor
3+
---
4+
5+
Fix missing react imports

packages/react-openapi/README.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
# `@gitbook/react-openapi`
22

3-
React components to render OpenAPI operations.
3+
Style-less React components to render OpenAPI operation blocks.
44

5-
## Features
6-
7-
- Generate code samples for the request
8-
- Support custom cde samples with `x-codeSamples` (Redocly syntax)
9-
10-
## TODO
11-
12-
- Support for trying out the request
5+
Note: The package is a TypeScript package and do not expose JS built files.

packages/react-openapi/src/Markdown.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import * as React from 'react';
12
import classNames from 'classnames';
23

34
export function Markdown(props: { source: string; className?: string }) {

packages/react-openapi/src/OpenAPICodeSample.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { OpenAPIV3 } from 'openapi-types';
1+
import * as React from 'react';
22

33
import { CodeSampleInput, codeSampleGenerators } from './code-samples';
44
import { OpenAPIOperationData, toJSON } from './fetchOpenAPIOperation';

packages/react-openapi/src/OpenAPIOperation.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import * as React from 'react';
12
import classNames from 'classnames';
23

34
import { OpenAPIOperationData, toJSON } from './fetchOpenAPIOperation';

packages/react-openapi/src/OpenAPIRequestBody.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import * as React from 'react';
2+
13
import { OpenAPIV3 } from 'openapi-types';
24
import { OpenAPIRootSchema } from './OpenAPISchema';
35
import { noReference } from './utils';

packages/react-openapi/src/OpenAPIResponse.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import * as React from 'react';
12
import classNames from 'classnames';
23
import { OpenAPIV3 } from 'openapi-types';
34
import { OpenAPIRootSchema, OpenAPISchemaProperties } from './OpenAPISchema';

packages/react-openapi/src/OpenAPIResponseExample.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import * as React from 'react';
12
import { InteractiveSection } from './InteractiveSection';
23
import { OpenAPIOperationData } from './fetchOpenAPIOperation';
34
import { generateSchemaExample } from './generateSchemaExample';

packages/react-openapi/src/OpenAPIResponses.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import * as React from 'react';
12
import classNames from 'classnames';
23
import { OpenAPIV3 } from 'openapi-types';
34
import { noReference } from './utils';

packages/react-openapi/src/OpenAPISecurities.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import * as React from 'react';
12
import { OpenAPIV3 } from 'openapi-types';
23
import { OpenAPIClientContext } from './types';
34
import { InteractiveSection } from './InteractiveSection';

0 commit comments

Comments
 (0)