Skip to content

Commit e6f6e3d

Browse files
committed
Adding document note about JSX d.ts file
1 parent 3be18b3 commit e6f6e3d

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,25 @@ const MyMap: React.FC = () => {
245245
export default MyMap;
246246
```
247247

248+
You may need to create a `*.d.ts` file for the custom element in React:
249+
250+
```ts
251+
// custom-elements.d.ts
252+
253+
declare module "react" {
254+
namespace JSX {
255+
interface IntrinsicElements {
256+
"capacitor-google-map": React.DetailedHTMLProps<
257+
React.HTMLAttributes<HTMLElement>,
258+
HTMLElement
259+
>;
260+
}
261+
}
262+
}
263+
264+
export {};
265+
```
266+
248267
### Vue
249268

250269
```vue

example-app-spm/src/custom-elements.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import "@capacitor/google-maps";
2-
31
declare module "react" {
42
namespace JSX {
53
interface IntrinsicElements {

plugin/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,25 @@ const MyMap: React.FC = () => {
245245
export default MyMap;
246246
```
247247

248+
You may need to create a `*.d.ts` file for the custom element in React:
249+
250+
```ts
251+
// custom-elements.d.ts
252+
253+
declare module "react" {
254+
namespace JSX {
255+
interface IntrinsicElements {
256+
"capacitor-google-map": React.DetailedHTMLProps<
257+
React.HTMLAttributes<HTMLElement>,
258+
HTMLElement
259+
>;
260+
}
261+
}
262+
}
263+
264+
export {};
265+
```
266+
248267
### Vue
249268

250269
```vue

0 commit comments

Comments
 (0)