Skip to content

Commit

Permalink
Trick TS instead of exporting object in a default export
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker committed Nov 1, 2023
1 parent fa25ca4 commit f276793
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
4 changes: 3 additions & 1 deletion packages/dnb-eufemia/src/components/flex/Flex.tsx
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export * as default from './'
// For TypeScript compatibility we import and export it this way
import * as _default from './'
export { _default as default }
7 changes: 3 additions & 4 deletions packages/dnb-eufemia/src/components/grid/Grid.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Container from './Container'
import Item from './Item'

export default { Container, Item }
// For TypeScript compatibility we import and export it this way
import * as _default from './'
export { _default as default }
10 changes: 2 additions & 8 deletions packages/dnb-eufemia/src/components/grid/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
/**
* Component Entry
*
*/

import Grid from './Grid'
export default Grid
export * from './Grid'
export { default as Container } from './Container'
export { default as Item } from './Item'
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
*/

import React from 'react'

import { Grid } from '../..'
import '../style'

export default {
title: 'Eufemia/Components/Layout',
}

export const colors = [
const colors = [
{ background: '#babeee' } as React.CSSProperties,
{ background: '#dfe0ee' } as React.CSSProperties,
{ background: '#90d2c3' } as React.CSSProperties,
Expand Down

0 comments on commit f276793

Please sign in to comment.