2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

数値と接尾辞が分離:HTMLで一体化できない問題

Posted at

前提

{record.time}のところにinputに入力した数値が入る形になっています。

数値と接尾辞が分離している箇所

.jsx
<span data-testid="time">{record.time}時間</span>

HTMLの構造
image.png

数値と接尾辞がHTMLの構造で一体化するように修正

.jsx
<span data-testid="time">{`${record.time}時間`}</span>

HTMLの構造
image.png

行ったこと

文字列とオブジェクトをテンプレートリテラルで結合させました。

まとめ

問題にあたったときには基礎的な構文や文法間違い等がないかなどを
まず確認するようにしていきたいと感じました。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?