Skip to content

Commit 378084d

Browse files
liweijie0812cnb
authored andcommitted
fix: 修复 React 模板 Typography 组件导致编译报错
修复 9 个 React 模板中 Typography 组件的类型错误: - 将带 theme 的 Typography.Paragraph 改为 Typography.Text(Paragraph 不支持 theme prop) - 移除 mobile 模板 Title 上悬空的 id 属性及 aria-labelledby PR-URL: #23
1 parent b49e954 commit 378084d

9 files changed

Lines changed: 24 additions & 24 deletions

File tree

templates/mobile-react-rsbuild/src/pages/Demo.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ export default function Demo() {
3030
<Typography.Title className="demo-card-title" level="h3">
3131
Hello, TDesign
3232
</Typography.Title>
33-
<Typography.Paragraph className="demo-card-copy" theme="secondary">
33+
<Typography.Text className="demo-card-copy" theme="secondary">
3434
点击按钮,体验这个模板中的基础交互。
35-
</Typography.Paragraph>
35+
</Typography.Text>
3636
<div className="counter" aria-label="计数器">
3737
<Button
3838
className="demo-button"

templates/mobile-react-rsbuild/src/pages/Home.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,14 @@ export default function HomePage() {
116116
</section>
117117
<div className="content-width workspace">
118118
<Demo />
119-
<section className="info-panel" aria-labelledby="info-title">
119+
<section className="info-panel">
120120
<div className="info-head">
121-
<Typography.Title className="info-title" level="h2" id="info-title">
121+
<Typography.Title className="info-title" level="h2">
122122
技术信息
123123
</Typography.Title>
124-
<Typography.Paragraph className="info-subtitle" theme="secondary">
124+
<Typography.Text className="info-subtitle" theme="secondary">
125125
当前模板使用的构建工具与组件库
126-
</Typography.Paragraph>
126+
</Typography.Text>
127127
</div>
128128
<CellGroup bordered={false} className="tech-cells">
129129
{techInfo.map((item) => (

templates/mobile-react-vike/pages/index/+Page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,14 @@ export default function Page() {
116116
</section>
117117
<div className="content-width workspace">
118118
<Demo />
119-
<section className="info-panel" aria-labelledby="info-title">
119+
<section className="info-panel">
120120
<div className="info-head">
121-
<Typography.Title className="info-title" level="h2" id="info-title">
121+
<Typography.Title className="info-title" level="h2">
122122
技术信息
123123
</Typography.Title>
124-
<Typography.Paragraph className="info-subtitle" theme="secondary">
124+
<Typography.Text className="info-subtitle" theme="secondary">
125125
当前模板使用的构建工具与组件库
126-
</Typography.Paragraph>
126+
</Typography.Text>
127127
</div>
128128
<CellGroup bordered={false} className="tech-cells">
129129
{techInfo.map((item) => (

templates/mobile-react-vike/pages/index/Demo.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ export default function Demo() {
3030
<Typography.Title className="demo-card-title" level="h3">
3131
Hello, TDesign
3232
</Typography.Title>
33-
<Typography.Paragraph className="demo-card-copy" theme="secondary">
33+
<Typography.Text className="demo-card-copy" theme="secondary">
3434
点击按钮,体验这个模板中的基础交互。
35-
</Typography.Paragraph>
35+
</Typography.Text>
3636
<div className="counter" aria-label="计数器">
3737
<Button
3838
className="demo-button"

templates/mobile-react-vite/src/pages/Demo.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ export default function Demo() {
3030
<Typography.Title className="demo-card-title" level="h3">
3131
Hello, TDesign
3232
</Typography.Title>
33-
<Typography.Paragraph className="demo-card-copy" theme="secondary">
33+
<Typography.Text className="demo-card-copy" theme="secondary">
3434
点击按钮,体验这个模板中的基础交互。
35-
</Typography.Paragraph>
35+
</Typography.Text>
3636
<div className="counter" aria-label="计数器">
3737
<Button
3838
className="demo-button"

templates/mobile-react-vite/src/pages/Home.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,14 @@ export default function HomePage() {
116116
</section>
117117
<div className="content-width workspace">
118118
<Demo />
119-
<section className="info-panel" aria-labelledby="info-title">
119+
<section className="info-panel">
120120
<div className="info-head">
121-
<Typography.Title className="info-title" level="h2" id="info-title">
121+
<Typography.Title className="info-title" level="h2">
122122
技术信息
123123
</Typography.Title>
124-
<Typography.Paragraph className="info-subtitle" theme="secondary">
124+
<Typography.Text className="info-subtitle" theme="secondary">
125125
当前模板使用的构建工具与组件库
126-
</Typography.Paragraph>
126+
</Typography.Text>
127127
</div>
128128
<CellGroup bordered={false} className="tech-cells">
129129
{techInfo.map((item) => (

templates/react-rsbuild/src/pages/Demo.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ export default function Demo() {
4141
<Typography.Title className="demo-card-title" level="h3">
4242
Hello, TDesign
4343
</Typography.Title>
44-
<Typography.Paragraph className="demo-card-copy" theme="secondary">
44+
<Typography.Text className="demo-card-copy" theme="secondary">
4545
点击按钮,体验这个模板中的基础交互。
46-
</Typography.Paragraph>
46+
</Typography.Text>
4747
<Space size={12} align="center">
4848
<Button
4949
theme="primary"

templates/react-vike/pages/index/Demo.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ export default function Demo() {
4141
<Typography.Title className="demo-card-title" level="h3">
4242
Hello, TDesign
4343
</Typography.Title>
44-
<Typography.Paragraph className="demo-card-copy" theme="secondary">
44+
<Typography.Text className="demo-card-copy" theme="secondary">
4545
点击按钮,体验这个模板中的基础交互。
46-
</Typography.Paragraph>
46+
</Typography.Text>
4747
<Space size={12} align="center">
4848
<Button
4949
theme="primary"

templates/react-vite/src/pages/Demo.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ export default function Demo() {
4141
<Typography.Title className="demo-card-title" level="h3">
4242
Hello, TDesign
4343
</Typography.Title>
44-
<Typography.Paragraph className="demo-card-copy" theme="secondary">
44+
<Typography.Text className="demo-card-copy" theme="secondary">
4545
点击按钮,体验这个模板中的基础交互。
46-
</Typography.Paragraph>
46+
</Typography.Text>
4747
<Space size={12} align="center">
4848
<Button
4949
theme="primary"

0 commit comments

Comments
 (0)