# 02 · intrinsic-elements **演示**:`JSX.IntrinsicElements` 定义每个标签的属性;`img` 缺 `alt` 会报错。 **运行**:在 `tutorials/typescript` 下执行 `npm run build`,再执行 `npm run serve`,打开 `http://localhost:8080/examples/29-jsx-react-types/02-intrinsic-elements/`;开 Console。 **预期控制台输出**(单行 HTML): ```text
``` **类型检查**:`node node_modules/typescript/bin/tsc -p examples/29-jsx-react-types/02-intrinsic-elements/tsconfig.types.json` **预期类型错误**(`demo/missing-alt.tsx`,由 `tsconfig.fail.json` 触发): ```text demo/missing-alt.tsx(6,10): error TS2741: Property 'alt' is missing in type '{ src: string; }' but required in type '{ src: string; alt: string; width?: number; }'. ``` **注意**:属性名用小写/`className` 还是 `class`,完全由 `IntrinsicElements` 决定。