score:3
Accepted answer
with quill.gettext()
function :
import react, { usestate } from "react";
import { usequill } from "react-quilljs";
export default () => {
const { quill, quillref } = usequill();
const [savedtext, setsavedtext] = usestate("");
const handlesave = () => {
const text = quill.gettext();
setsavedtext(text);
};
return (
<div style={{ width: 500, height: 300 }}>
<button onclick={handlesave}>save</button>
<div>saved state : {savedtext}</div>
<div ref={quillref} />
</div>
);
};
check on codesandbox : https://codesandbox.io/s/react-quilljsbasic-tt6pm?file=/src/app.js
Source: stackoverflow.com
Related Query
- Getting values from a text editor in React js
- Getting values from material-ui Button in React
- Expect toContain text from a set of values in jest,enzyme with React
- React get values from dynamically added inputs text fields
- Getting multiple checkbox values from react not working
- Getting values from dropdown and inputs in react
- Getting text of PNG from Postgres DB and sending image to front-end React
- How to get the value from Text Editor in React Js? [Snippet attached]
- MaterialUI Text Field input getting 'undefined' values with React Hooks
- Getting UNDEFINED values from Firestore onSnapshot + Promises for my React State
- React read input values from multiple input text fields
- Getting text from React wrapped span using webdriverio
- How can I render tags from Rich Text Editor in Prismic React Client?
- cannot get the text box values from react
- React - getting a component from a DOM element for debugging
- Getting DOM node from React child element
- How to get values from child components in React
- Passing react text field input values as parameters to a method
- Text is getting cut off in android for react native
- Create PDF file from HTML text React
- Add text inside doughnut chart from chart js-2 in react
- How to compare values from react redux state in hooks
- Embedded React + JSS component: how to protect generic elements like <button>, <p> from getting including page's style?
- How to get values from react FieldArray in formik form with other fields?
- React app componentDidMount not getting props from parent
- My React app is using values from the .env file instead of the .env.local file
- Getting error when try to use React Router v6: Attempted import error: 'Action' is not exported from 'history'
- React query mutation: getting the response from the server with onError callback when the API call fails
- Passing Values via Props From React Stateless Child to Parent
- React - this.state is null inside render when getting data from API
More Query from same tag
- Eslint error on using callback hooks in React
- TypeError: Cannot read property 'vote' of null in render view
- How to add a videojs plugin on React hooks
- In react form, cannot type in text fields or click or hover over button
- Change the thickness of Tabs' indicator in MUI
- How to avoid creating references of 'this' in ES6: const that = this when scope nested in React
- React-Bootstrap ONLY Close Button Styling Not Working
- Reactjs/Redux Edit functionality not working
- Material-ui adding Link component from react-router
- Fit component to screen, No scrolling React-native
- ReactJS/nextJS: Don't get access to cookie/properties after redirecting
- TypeScript error - Property 'get' does not exist on type 'Reference'. TS2339
- Client not receiving json response from server
- React +getting value from queryString
- Methods of matching string input with numerical input in ReactJS?
- React & Redux - Handling mutation of state after call API in useEffect
- How to avoid repetition of carousel items in react-slick
- Docker Multi-stage build - Copy failing
- auto read SMS/OTP in react PWA
- Getting error: "react.createclass is not a function"
- How to avoid re-renders in React when using conditional Render and children node prop
- Search filter in React?
- Setup for browser.js current its on watch all the time after call npm run test
- Access a variable defined in a CommonJS library from the global browser scope
- how to make reactjs call Component from external file
- Insert value on 0 index in dropdown
- Get array of documents from array of ids in firestore using React
- Mock react-dom Jest
- How to access env variables using react?
- null values for instead of date causes the browser to crash while using chart js