Victor
Victor

Reputation: 835

Best way to add spell check for react app?

What is the best way to add spell check (with custom suggestion menu) to react app? For example to textarea element. I know that it's possible with the server-side and with vanilla javascript. So what's the best way? Maybe you have some solutions?

Upvotes: 3

Views: 17400

Answers (2)

Ansuman
Ansuman

Reputation: 74

Here , the spellcheck attribute is true, so it will give the red underline if we write something wrong in content.

To remove that we can set the spellcheck attribute to be "false". instead of

 <h1 className="heading" contentEditable="true" spellCheck="true">Hello</h1>

we can make it

 <h1 className="heading" contentEditable="true" spellCheck="false">Hello</h1>

Upvotes: 0

David Buzatu
David Buzatu

Reputation: 644

Take a look at docs: Official React Docs.

If for basic html/vanillajs you would use a textarea like:

<textarea spellcheck="true" />

In React, you would use: <textarea spellCheck="true" />

Upvotes: 5

Related Questions