-1

I tried to Use "$" Dollar Sign in React JS Class Name

`
p class Name={'"chat-message" ${true && "enter code herechat-reciever"}'}>
`

When I used above code I doesn't work correctly. Here I'm Using Class Name in WhatsApp Clone. I want to use JavaScript for Whether This Message was sent by me or Received. Also I'm want to make second Class as True

Ajay Raja
  • 132
  • 1
  • 7

1 Answers1

0

Template literals need to delimited with backticks

p class Name={`"chat-message" ${true && "enter code here`chat-reciever"}`} 
Ryan Le
  • 6,396
  • 1
  • 10
  • 19