@@ -1643,31 +1643,29 @@ export default MyBasicForNoTagRefComponent;
1643
1643
exports[`Preact > jsx > Javascript Test > basicForwardRef 1`] = `
1644
1644
"/** @jsx h */
1645
1645
import { h, Fragment } from \\"preact\\";
1646
- import { useState, forwardRef } from \\"preact/hooks\\";
1646
+ import { useState } from \\"preact/hooks\\";
1647
1647
1648
- const MyBasicForwardRefComponent = forwardRef(
1649
- function MyBasicForwardRefComponent(props, inputRef) {
1650
- const [name, setName] = useState(() => \\"PatrickJS\\");
1648
+ function MyBasicForwardRefComponent(props) {
1649
+ const [name, setName] = useState(() => \\"PatrickJS\\");
1651
1650
1652
- return (
1653
- <Fragment>
1654
- <div>
1655
- <input
1656
- className=\\"input\\"
1657
- ref={inputRef}
1658
- value={name}
1659
- onChange={(event) => setName(event.target.value)}
1660
- />
1661
- </div>
1662
- <style jsx>{\`
1663
- .input {
1664
- color: red;
1665
- }
1666
- \`}</style>
1667
- </Fragment>
1668
- );
1669
- }
1670
- );
1651
+ return (
1652
+ <Fragment>
1653
+ <div>
1654
+ <input
1655
+ className=\\"input\\"
1656
+ ref={props.inputRef}
1657
+ value={name}
1658
+ onChange={(event) => setName(event.target.value)}
1659
+ />
1660
+ </div>
1661
+ <style jsx>{\`
1662
+ .input {
1663
+ color: red;
1664
+ }
1665
+ \`}</style>
1666
+ </Fragment>
1667
+ );
1668
+ }
1671
1669
1672
1670
export default MyBasicForwardRefComponent;
1673
1671
"
@@ -1676,31 +1674,29 @@ export default MyBasicForwardRefComponent;
1676
1674
exports[`Preact > jsx > Javascript Test > basicForwardRefMetadata 1`] = `
1677
1675
"/** @jsx h */
1678
1676
import { h, Fragment } from \\"preact\\";
1679
- import { useState, forwardRef } from \\"preact/hooks\\";
1677
+ import { useState } from \\"preact/hooks\\";
1680
1678
1681
- const MyBasicForwardRefComponent = forwardRef(
1682
- function MyBasicForwardRefComponent(props, inputRef) {
1683
- const [name, setName] = useState(() => \\"PatrickJS\\");
1679
+ function MyBasicForwardRefComponent(props) {
1680
+ const [name, setName] = useState(() => \\"PatrickJS\\");
1684
1681
1685
- return (
1686
- <Fragment>
1687
- <div>
1688
- <input
1689
- className=\\"input\\"
1690
- ref={inputRef}
1691
- value={name}
1692
- onChange={(event) => setName(event.target.value)}
1693
- />
1694
- </div>
1695
- <style jsx>{\`
1696
- .input {
1697
- color: red;
1698
- }
1699
- \`}</style>
1700
- </Fragment>
1701
- );
1702
- }
1703
- );
1682
+ return (
1683
+ <Fragment>
1684
+ <div>
1685
+ <input
1686
+ className=\\"input\\"
1687
+ ref={props.inputRef}
1688
+ value={name}
1689
+ onChange={(event) => setName(event.target.value)}
1690
+ />
1691
+ </div>
1692
+ <style jsx>{\`
1693
+ .input {
1694
+ color: red;
1695
+ }
1696
+ \`}</style>
1697
+ </Fragment>
1698
+ );
1699
+ }
1704
1700
1705
1701
export default MyBasicForwardRefComponent;
1706
1702
"
@@ -5059,36 +5055,34 @@ export default MyBasicForNoTagRefComponent;
5059
5055
exports[`Preact > jsx > Typescript Test > basicForwardRef 1`] = `
5060
5056
"/** @jsx h */
5061
5057
import { h, Fragment } from \\"preact\\";
5062
- import { useState, forwardRef } from \\"preact/hooks\\";
5058
+ import { useState } from \\"preact/hooks\\";
5063
5059
5064
5060
export interface Props {
5065
5061
showInput: boolean;
5066
5062
inputRef: HTMLInputElement;
5067
5063
}
5068
5064
5069
- const MyBasicForwardRefComponent = forwardRef<Props[\\"inputRef\\"]>(
5070
- function MyBasicForwardRefComponent(props: Props, inputRef) {
5071
- const [name, setName] = useState(() => \\"PatrickJS\\");
5065
+ function MyBasicForwardRefComponent(props: Props) {
5066
+ const [name, setName] = useState(() => \\"PatrickJS\\");
5072
5067
5073
- return (
5074
- <Fragment>
5075
- <div>
5076
- <input
5077
- className=\\"input\\"
5078
- ref={inputRef}
5079
- value={name}
5080
- onChange={(event) => setName(event.target.value)}
5081
- />
5082
- </div>
5083
- <style jsx>{\`
5084
- .input {
5085
- color: red;
5086
- }
5087
- \`}</style>
5088
- </Fragment>
5089
- );
5090
- }
5091
- );
5068
+ return (
5069
+ <Fragment>
5070
+ <div>
5071
+ <input
5072
+ className=\\"input\\"
5073
+ ref={props.inputRef}
5074
+ value={name}
5075
+ onChange={(event) => setName(event.target.value)}
5076
+ />
5077
+ </div>
5078
+ <style jsx>{\`
5079
+ .input {
5080
+ color: red;
5081
+ }
5082
+ \`}</style>
5083
+ </Fragment>
5084
+ );
5085
+ }
5092
5086
5093
5087
export default MyBasicForwardRefComponent;
5094
5088
"
@@ -5097,36 +5091,34 @@ export default MyBasicForwardRefComponent;
5097
5091
exports[`Preact > jsx > Typescript Test > basicForwardRefMetadata 1`] = `
5098
5092
"/** @jsx h */
5099
5093
import { h, Fragment } from \\"preact\\";
5100
- import { useState, forwardRef } from \\"preact/hooks\\";
5094
+ import { useState } from \\"preact/hooks\\";
5101
5095
5102
5096
export interface Props {
5103
5097
showInput: boolean;
5104
5098
inputRef: HTMLInputElement;
5105
5099
}
5106
5100
5107
- const MyBasicForwardRefComponent = forwardRef<Props[\\"inputRef\\"]>(
5108
- function MyBasicForwardRefComponent(props: Props, inputRef) {
5109
- const [name, setName] = useState(() => \\"PatrickJS\\");
5101
+ function MyBasicForwardRefComponent(props: Props) {
5102
+ const [name, setName] = useState(() => \\"PatrickJS\\");
5110
5103
5111
- return (
5112
- <Fragment>
5113
- <div>
5114
- <input
5115
- className=\\"input\\"
5116
- ref={inputRef}
5117
- value={name}
5118
- onChange={(event) => setName(event.target.value)}
5119
- />
5120
- </div>
5121
- <style jsx>{\`
5122
- .input {
5123
- color: red;
5124
- }
5125
- \`}</style>
5126
- </Fragment>
5127
- );
5128
- }
5129
- );
5104
+ return (
5105
+ <Fragment>
5106
+ <div>
5107
+ <input
5108
+ className=\\"input\\"
5109
+ ref={props.inputRef}
5110
+ value={name}
5111
+ onChange={(event) => setName(event.target.value)}
5112
+ />
5113
+ </div>
5114
+ <style jsx>{\`
5115
+ .input {
5116
+ color: red;
5117
+ }
5118
+ \`}</style>
5119
+ </Fragment>
5120
+ );
5121
+ }
5130
5122
5131
5123
export default MyBasicForwardRefComponent;
5132
5124
"
0 commit comments