参考記事 Multiple event listeners in Next.js router
カテゴリーアーカイブ: JavaScript
Uncaught Error: The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + ’em’}} when using JSX.
Reactでタイトルのエラーが発生 styleを{{}}で囲うで対処しました 参考記事 React inline style – style prop expects a mapping from style …
ReactにTypescript入れたらModule not found: Error: Can’t resolve
タイトルエラーが発生 問題の箇所はwebpackでtsx と記載すべきところをts としていたことが原因でした 参考記事 TypeScript + webpackでModule not foundでハマった
bundle.js:2 Uncaught ReferenceError: regeneratorRuntime is not defined
reactにaxiosを入れたらタイトルのエラー発生 で行けました 参考記事 async/awaitを使用して、”regeneratorRuntime is not defined “エラーが出た …
“bundle.js:2 Uncaught ReferenceError: regeneratorRuntime is not defined” の続きを読む
React on Flask
Reactをstatic dirで管理(ガッツリではなくjquery的な感じで使いたい) Webpackでbuildを作成したい で作成する方法調べたところ下記の記事がとても参考になりました Adding a React …
configuration.devtool should match pattern “^(inline-|hidden-|eval-)?(nosources-)?(cheap-(module-)?)?source-map$”
flaskにwebpackの乗せてreactを走らせようとしたところエラーが発生 結論 -d オプションを削除すると動く 参考記事 webpack v5 devtool should match pattern
Reactでraw htmlを使う方法
ライブラリを入れるのは嫌だったので、このコードを参考にしたところ簡単に導入できました 参考記事 Render the HTML raw in React app Save
Stripe elementでregisterElement not defined が出る場合の対処法
少し修正したらタイトルのエラーが発生 調べてみたところ、どうやらstripeのバグらしく、registerElementのコードをソースから引っ張ってきて追加することで対処できるとのことです。 一部変数にダブりがあったの …
“Stripe elementでregisterElement not defined が出る場合の対処法” の続きを読む
Reactのselectでselectedを指定する方法
Modalで閉じるたびにselectが解除されてしまったいたので、調べたところこんな感じで実装することで常にselected状態を維持できるようです optionState にvalue=”A” のA とか B が入るよ …
rails5系でwebpack + reactを導入する方法
下記の手順で行けました! 参考記事 https://learnetto.com/tutorials/how-to-use-react-with-the-webpacker-gem-and-rails-5-1