Skip to content

Commit

Permalink
Remove invalid type example
Browse files Browse the repository at this point in the history
  • Loading branch information
danreeves committed Jun 7, 2022
1 parent 563966b commit 516fbdc
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions test/typescript/Trans.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,14 @@ function objectComponents() {
return <Trans components={{ Btn: <button /> }} defaults="Hello <Btn />" />;
}

function MyComponent(): React.ReactElement {
function MyComponent() {
return <>world</>;
}

function objectCustomComponents() {
return <Trans components={{ Btn: <MyComponent /> }} defaults="Hello <Btn />" />;
}

function objectCustomComponentsShouldError() {
return (
<Trans
// Valid ReactNodes according to types
components={{
Btn: MyComponent,
Btn2: null,
Btn4: true,
Btn5: {},
}}
defaults="Hello <Btn /><Btn2 /><Btn3 /><Btn4 /><Btn5 />"
/>
);
}

function constObjectComponents() {
const constObject = {
Btn: <button />,
Expand Down

0 comments on commit 516fbdc

Please sign in to comment.