{"id":5184,"date":"2022-01-18T21:42:54","date_gmt":"2022-01-18T12:42:54","guid":{"rendered":"https:\/\/akamist.com\/blog\/?p=5184"},"modified":"2022-01-18T21:43:06","modified_gmt":"2022-01-18T12:43:06","slug":"%e3%82%a8%e3%83%a9%e3%83%bc%e3%80%8ccould-not-find-a-declaration-file-for-module-react-dom%e3%80%8d%e3%81%8c%e5%87%ba%e3%82%8b%e6%99%82","status":"publish","type":"post","link":"https:\/\/akamist.com\/blog\/archives\/5184","title":{"rendered":"\u30a8\u30e9\u30fc\u300cCould not find a declaration file for module 'react-dom'\u300d\u304c\u51fa\u308b\u6642"},"content":{"rendered":"<h2>\u30a8\u30e9\u30fc\u306e\u5185\u5bb9<\/h2>\n<p>\u4ee5\u4e0b\u306eimport\u3092\u542b\u3080tsx\u30d5\u30a1\u30a4\u30eb\u3092VSCode\u3067\u958b\u304f\u3068\u4e0b\u8a18\u306e\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u305f\u3002<\/p>\n<p>tsx\u30d5\u30a1\u30a4\u30eb\u306e\u8a18\u8ff0<\/p>\n<pre><code class=\"language-tsx\">import ReactDOM from 'react-dom';\n<\/code><\/pre>\n<p>\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8<\/p>\n<pre><code class=\"language-bash\">Could not find a declaration file for module 'react-dom'. \n'node_modules\/react-dom\/index.js' implicitly has an 'any' type.\n\nTry `npm i --save-dev @types\/react-dom` if it exists or add a new declaration (.d.ts) file \ncontaining `declare module 'react-dom';\n<\/code><\/pre>\n<h2>\u539f\u56e0<\/h2>\n<p>npm\u3067<code>@types\/react-dom<\/code>\u3092install\u3057\u3066\u3044\u306a\u304b\u3063\u305f\u3002<\/p>\n<h2>\u5bfe\u5fdc<\/h2>\n<p>\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306b\u3042\u308b\u3088\u3046\u306b\u3001\u30b3\u30de\u30f3\u30c9<code>npm i --save-dev @types\/react-dom<\/code>\u3092\u5b9f\u884c\u3057\u3066\u3001\u8a72\u5f53\u306e\u3082\u306e\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3089\u30a8\u30e9\u30fc\u304c\u89e3\u6d88\u3055\u308c\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30a8\u30e9\u30fc\u306e\u5185\u5bb9 \u4ee5\u4e0b\u306eimport\u3092\u542b\u3080tsx\u30d5\u30a1\u30a4\u30eb\u3092VSCode\u3067\u958b\u304f\u3068\u4e0b\u8a18\u306e\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u305f\u3002 tsx\u30d5\u30a1\u30a4\u30eb\u306e\u8a18\u8ff0 import ReactDOM from 'react-dom'; \u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8 Could [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":5188,"url":"https:\/\/akamist.com\/blog\/archives\/5188","url_meta":{"origin":5184,"position":0},"title":"\u30d5\u30a1\u30a4\u30eb\u306e\u982d\u306b\u300cimport React from 'react';\u300d\u3092\u66f8\u304f\u5fc5\u8981\u304c\u3042\u308b\u304b\u306b\u3064\u3044\u3066 (TS17004\u3001TS2686\u30a8\u30e9\u30fc)","date":"2022\u5e741\u670819\u65e5","format":false,"excerpt":"React\u306b\u95a2\u3059\u308b\u66f8\u7c4d\u30fbweb\u8a18\u4e8b\u3092\u898b\u3066\u3044\u308b\u3068\u3001\u5834\u5408\u3088\u3063\u3066\u306fjsx\/tsx\u30d5\u30a1\u30a4\u30eb\u306e\uff11\u884c\u76ee\u306b`imp\u2026","rel":"","context":"\u672a\u5206\u985e","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/akamist.com\/blog\/wp-content\/uploads\/2022\/01\/icon_react.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":5171,"url":"https:\/\/akamist.com\/blog\/archives\/5171","url_meta":{"origin":5184,"position":1},"title":"ReactDOM is not defined\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u3068\u304d\u306b\u78ba\u8a8d\u3059\u308b\u3053\u3068","date":"2022\u5e741\u670818\u65e5","format":false,"excerpt":"## \u767a\u751f\u3057\u305f\u4e8b\u8c61 React\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092`yarn run webpack`\u3067\u4f5c\u6210\u3057\u305f\u3068\u3053\u308d\u3001\u30d3\u2026","rel":"","context":"\u672a\u5206\u985e","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5503,"url":"https:\/\/akamist.com\/blog\/archives\/5503","url_meta":{"origin":5184,"position":2},"title":"styled-components\u3092import\u3059\u308b\u3068TS7016\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u3068\u304d","date":"2022\u5e745\u670814\u65e5","format":false,"excerpt":"## \u30a8\u30e9\u30fc\u306e\u5185\u5bb9 TypeScript\u3067\u3001styled-components\u3092import\u3059\u308b\u3068\u3001\u2026","rel":"","context":"JavaScript","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/akamist.com\/blog\/wp-content\/uploads\/2022\/01\/icon_typescript.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":5215,"url":"https:\/\/akamist.com\/blog\/archives\/5215","url_meta":{"origin":5184,"position":3},"title":"\u30a8\u30e9\u30fc: Field 'browser' doesn't contain a valid alias configuration\u304c\u51fa\u308b\u6642[React]","date":"2022\u5e741\u670820\u65e5","format":false,"excerpt":"## \u767a\u751f\u3057\u305f\u30a8\u30e9\u30fc React\u3067tsx\u30d5\u30a1\u30a4\u30eb\u3092import\u3057\u3088\u3046\u3068\u3057\u305f\u3089\u3001webpack\u306e\u30d3\u30eb\u30c9\u2026","rel":"","context":"\u672a\u5206\u985e","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4977,"url":"https:\/\/akamist.com\/blog\/archives\/4977","url_meta":{"origin":5184,"position":4},"title":"create-react-app ver5\u304b\u3089React Router\u306eV6\u3092\u4f7f\u3046","date":"2022\u5e741\u67082\u65e5","format":false,"excerpt":"## \u306f\u3058\u3081\u306b \u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001craete-react-app\u306eV5\u3067\u4f5c\u6210\u3057\u305fReact\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u2026","rel":"","context":"JavaScript","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/akamist.com\/blog\/wp-content\/uploads\/2022\/01\/icon_react.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":5528,"url":"https:\/\/akamist.com\/blog\/archives\/5528","url_meta":{"origin":5184,"position":5},"title":"TypeScript: eslint\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b","date":"2022\u5e745\u670828\u65e5","format":false,"excerpt":"React + TypeScript (craete-react-app\u306f\u672a\u4f7f\u7528)\u306e\u74b0\u5883\u306beslin\u2026","rel":"","context":"\u672a\u5206\u985e","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/posts\/5184"}],"collection":[{"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/comments?post=5184"}],"version-history":[{"count":3,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/posts\/5184\/revisions"}],"predecessor-version":[{"id":5187,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/posts\/5184\/revisions\/5187"}],"wp:attachment":[{"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/media?parent=5184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/categories?post=5184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/tags?post=5184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}