Skip to content

Commit

Permalink
Add temporary id story
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker committed Dec 13, 2024
1 parent 532c24e commit 15e7ce5
Showing 1 changed file with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*
*/

import React, { useEffect } from 'react'
import React, { useEffect, useRef } from 'react'
import { Wrapper, Box } from 'storybook-utils/helpers'
import { Upload } from '../..'
import { Tabs, Upload } from '../..'

export default {
title: 'Eufemia/Components/Upload',
Expand Down Expand Up @@ -158,3 +158,21 @@ export const UploadSandbox = () => {
export const UploadSimple = () => {
return <Upload id="upload-simple-example" acceptedFileTypes={['pdf']} />
}

function MyUploadComponent(props) {
const id = useRef({}).current
return <Upload id={id} {...props} />
}

export function InTabs() {
return (
<Tabs>
<Tabs.Content title="Tab 1" key="a">
<MyUploadComponent acceptedFileTypes={['png']} />
</Tabs.Content>
<Tabs.Content title="Tab 2" key="b">
<MyUploadComponent acceptedFileTypes={['jpg']} />
</Tabs.Content>
</Tabs>
)
}

0 comments on commit 15e7ce5

Please sign in to comment.