-
Notifications
You must be signed in to change notification settings - Fork 585
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: change defaultProps generation for react (#1661)
* refactor: change defaultProps generation for react * chore: update snapshots * refactor: default props passing for react * fix: issues with e2e tests * fix: issue with e2e for stencil * chore: run fmt * fix: issue with vue default props * fix: issue with default props for e2e tests * fix: issue with stencil e2e test for default props * fix: issue with stencil types for e2e * fix: issue with stencil local exports * chore: add test results upload to find issues with e2e tests * chore: rename default-props.lite.tsx to fix issue with react e2e * chore: provide e2e builds on failure * chore: exclude node_modules * test: trigger avoiding nx remote cache * fix: issue with rsc functions * chore: update snapshots * fix: issue with doubled variable name * chore: update snapshots
- Loading branch information
Showing
54 changed files
with
3,607 additions
and
1,812 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@builder.io/mitosis': patch | ||
--- | ||
|
||
[react]: Changed `defaultProps` generation for react, because defaultProps for function components is deprecated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export const COMPONENT_PATHS = [ | ||
'/default-props/', | ||
'/one-component/', | ||
'/two-components/', | ||
'/types/', | ||
|
18 changes: 18 additions & 0 deletions
18
e2e/e2e-app/src/components/default-props/use-default-props.lite.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { useDefaultProps, useStore } from '@builder.io/mitosis'; | ||
|
||
useDefaultProps({ foo: 'abc', bar: 'foo' }); | ||
|
||
type DefaultPropsType = { | ||
foo?: string; | ||
bar?: string; | ||
}; | ||
|
||
export default function DefaultProps(props: DefaultPropsType) { | ||
const state = useStore({ | ||
getProps: () => { | ||
return JSON.stringify({ foo: props.foo, bar: props.bar }); | ||
}, | ||
}); | ||
|
||
return <div data-testid="default-props">{state.getProps()}</div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.