score:7
Accepted answer
in order to access to quill
editor, you have to create an ref
to the <quill />
component, then use it to set the attribute. here is the snippet code:
// for typings
import quill from "react-quill";
import quilleditor from "quill"
export const contenteditor = ({ content, onchange }) => {
const ref = react.useref<quill & { editor: quilleditor }>(null);
// disable spellcheck as component is mounted
react.useeffect(() => {
ref.current?.editor.root.setattribute("spellcheck", "false");
}, []);
return (
<quill
// set the ref to access to quill editor
ref={ref}
theme="snow"
value={content}
onchange={onchange}
modules={modules}
formats={formats}
/>
);
};
i have also made an sample as well: https://codesandbox.io/s/stoic-mendel-4g3jw?file=/src/app.js
Source: stackoverflow.com
Related Query
- How turn off spell check in QuillJS (React)
- How to turn off autoplay for React Bootstrap Carousel?
- how to turn off autocomplete of a form when switching in react form?
- How to check how many React children have a certain prop?
- React - How to check if JWT is valid before sending a post request?
- How to check for broken images in React JS
- how to check the actual DOM node using react enzyme
- In React Router v6, how to check form is dirty before leaving page/route
- How to check when the react components get rendered or rerendered
- React check how many times a component re-renders
- How to turn off CSS module feature in Next.js?
- How to check props of a DOM node in an unit test in React 0.14?
- react native how to check if Component current show in screen
- React Navigation 2: How to check previous scene and to disable tab change
- how to load radio buttons dynamically and use check property in react js?
- How to check if Dom Element or React Component
- How to check if a div is overflowing in react functional component
- How to check if a React element will render anything
- Turn off autoComplete for all inputs in React app
- PhpStorm - how to turn off automatic curly brace insertion
- How to check Current version of React using command prompt
- Turn off ESLint rule (in React app, using WebStorm)
- How do I check if user is 'logged in' in a react component when using laravel authentication?
- How to check if state default boolean false is changing to true with React Hook useEffect
- How to check what react component displays after delay in a test
- How to get JWT cookies in our react application, how to check the user is login or not I am unable to find how to handle my react application session
- How can I check the type of material ui theme in react js? (light or dark)
- How to check if a component has been clicked after an onblur event in React
- How to check whether a property supplied to React component is an instance of Immutable.js Record with Flow?
- How to check the value of a nested React component in a unit test with Enzyme and Jest
More Query from same tag
- Writing on firestore document using cloud functions(using react.js)
- redux-sagas callback (aka sagas and setState)
- Contentful Content Management API Error 422 When Creating Asset
- Compare this.state to a function to apply style
- Webpack compiling throwing error with mobx
- how to remove duplicate values from Array using reactjs?
- React.js library not working on CodePen?
- Share mutable state between multiple invocations of a React component with hooks
- How can I request a new access token after the existing token expires with the firebase refresh token?
- check if JSON has child elements multiple times within a return
- How would I convert this (file upload) class component into a functional component in React?
- Handle mouse hover events over a mapped array in React
- How to distinguish between a prop and a method with the same name, in Vue?
- Aria attributes not changing with fireEvents on using jest and react testing library
- Update state on scroll react hook
- Why is toggling the dropdown when I click enter key on input field?
- How to remove React hook in certain conditions?
- Can't render auth page
- How to keep state immutable if state is of Set type? How to make copy of javascript Set type?
- Redirect to login only if user is not authenticated react
- Handle Click Outside of Render()
- Webpack 5 and Storybook 6 integration throws an error in DefinePlugin.js
- Why componentDidUpdate is executing repeatedly
- How to filter out duplicate names with returned JSON data
- How to call var in return ()
- React props(JSX)
- how to accept only apk file in react js?
- CytoscapeJS calling setState function in React
- Changing style property with setState in React
- Received NaN for the `children` attribute. If this is expected, cast the value to a string