SHISME / react-native-draggable-grid

A draggable and sortable grid of react-native
320 stars 95 forks source link

TS error. IDraggableGridProps requires using export type #66

Closed michal-antczak closed 2 years ago

michal-antczak commented 2 years ago

Hey!

We are facing weird issue with:

Package version: "react-native-draggable-grid": "^2.1.4",

TS throws error when run command tsc --noEmit && eslint src/**/*.ts{,x}

Screenshot 2022-02-15 at 17 35 11

Our eslintrc.js contains:

{
  ...
  parser: '@typescript-eslint/parser',
  parserOptions: {
    ecmaFeatures: {
      jsx: true,
    },
    ecmaVersion: 2021,
    sourceType: 'module',
    project: './tsconfig.json',
  },
  ...
}

and tsconfig has:

"isolatedModules": true

One of the solution is to switch that isolatedModules flag to false, the error goes away, but we would like to avoid it. The other is to change the way how the IDraggableProps are exported from src/index.ts file.

We change the node_modules/react-native-draggable-grid/src/index.ts to get rid of the error:


import { DraggableGrid, IDraggableGridProps } from './draggable-grid'

export type { IDraggableGridProps }
export { DraggableGrid }

export default DraggableGrid

but it doesn't feel right. Is it all right if I make a PR to change /src/index.ts file or this change might affect other part of package?

SHISME commented 2 years ago

OK,i will update typescript version and useexport type