Skip to content

Commit

Permalink
fix(packages): add index.js in /solid and /react (#5863)
Browse files Browse the repository at this point in the history
* Rename swiper-solid.js and swiper-react.js to index.js

This way the following code is valid:
```js
// With SolidJS
import { Swiper } from "swiper/solid"
// With React
import { Swiper } from "swiper/react"
```

* Allow both types of imports
  • Loading branch information
TiagoCavalcante authored Jul 8, 2022
1 parent f229ef3 commit 6e94701
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/react/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './swiper-react';
1 change: 1 addition & 0 deletions src/react/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './swiper-react.js';
2 changes: 1 addition & 1 deletion src/react/swiper-react.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';

import { SwiperOptions, Swiper as SwiperClass } from '../types/';
import { SwiperOptions, Swiper as SwiperClass } from '../types';

interface SwiperProps extends SwiperOptions {
/**
Expand Down
1 change: 1 addition & 0 deletions src/solid/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './swiper-solid';
1 change: 1 addition & 0 deletions src/solid/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './swiper-solid.js';

0 comments on commit 6e94701

Please sign in to comment.