Skip to content

Commit

Permalink
fix: issue with missing uuid function for react
Browse files Browse the repository at this point in the history
  • Loading branch information
nmerget committed Feb 27, 2024
1 parent 267dc71 commit d34baad
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 14 deletions.
4 changes: 4 additions & 0 deletions packages/components/scripts/post-build/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ module.exports = (tmp) => {
{
from: /<\/>/g,
to: '</React.Fragment>'
},
{
from: '{ cls }',
to: '{ cls, uuid }'
}
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import {
useStore
} from '@builder.io/mitosis';
import { DBCheckboxProps, DBCheckboxState } from './model';
import { uuid } from '../../utils';
import { cls, uuid } from '../../utils';
import { DEFAULT_ID } from '../../shared/constants';
import { cls } from '../../utils';
import { ChangeEvent, InteractionEvent } from '../../shared/model';

useMetadata({
Expand Down
3 changes: 1 addition & 2 deletions packages/components/src/components/drawer/drawer.lite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import {
import { DBDrawerState, DBDrawerProps } from './model';
import { DBButton } from '../button';
import { DEFAULT_CLOSE_BUTTON, DEFAULT_ID } from '../../shared/constants';
import { cls } from '../../utils';
import { uuid } from '../../utils';
import { cls, uuid } from '../../utils';

useMetadata({
isAttachedToShadowDom: true,
Expand Down
3 changes: 1 addition & 2 deletions packages/components/src/components/radio/radio.lite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import {
useStore
} from '@builder.io/mitosis';
import { DBRadioProps, DBRadioState } from './model';
import { uuid } from '../../utils';
import { DEFAULT_ID } from '../../shared/constants';
import { cls } from '../../utils';
import { cls, uuid } from '../../utils';
import { ChangeEvent, InteractionEvent } from '../../shared/model';

useMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
useStore
} from '@builder.io/mitosis';
import { DBTabListProps, DBTabListState } from './model';
import { cls, uuid } from '../../utils';
import { cls } from '../../utils';
import { DEFAULT_ID } from '../../shared/constants';

useMetadata({
Expand All @@ -22,7 +22,6 @@ export default function DBTabList(props: DBTabListProps) {
});

onMount(() => {
state._id = props.id || 'tab-list-' + uuid();
if (props.stylePath) {
state.stylePath = props.stylePath;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
useStore
} from '@builder.io/mitosis';
import { DBTabPanelProps, DBTabPanelState } from './model';
import { cls, uuid } from '../../utils';
import { cls } from '../../utils';
import { DEFAULT_ID } from '../../shared/constants';

useMetadata({
Expand All @@ -22,7 +22,6 @@ export default function DBTabPanel(props: DBTabPanelProps) {
});

onMount(() => {
state._id = props.id || 'tab-panel-' + uuid();
if (props.stylePath) {
state.stylePath = props.stylePath;
}
Expand Down
5 changes: 1 addition & 4 deletions packages/components/src/components/tab/tab.lite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ import {
onMount,
onUpdate,
Show,
Slot,
useMetadata,
useRef,
useStore
} from '@builder.io/mitosis';
import type { DBTabProps, DBTabState } from './model';
import { cls, uuid } from '../../utils';
import { ClickEvent } from '../../shared/model';
import { cls } from '../../utils';
import { DEFAULT_ID } from '../../shared/constants';

useMetadata({
Expand All @@ -25,7 +23,6 @@ export default function DBTab(props: DBTabProps) {
});

onMount(() => {
state._id = props.id || 'tab-' + uuid();
state.initialized = true;
if (props.stylePath) {
state.stylePath = props.stylePath;
Expand Down

0 comments on commit d34baad

Please sign in to comment.