Skip to content

Commit 95d76fe

Browse files
chore: format
1 parent b8805d4 commit 95d76fe

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

react-quill/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Using react-quill (WYSIWYG) in Remix application
22

3-
In this example we are implementing a WYSIWYG editor with Quill.
3+
In this example we are implementing a WYSIWYG editor with Quill.
44

55
We have used react-quill as our library of choice to implement it.
66

@@ -14,7 +14,7 @@ Open this example on [CodeSandbox](https://codesandbox.com):
1414

1515
WYSIWYG editor with react-quill
1616

17-
Because `react-quill` uses `window` features under the hood, you should create a wrapper with [`remix-utils`](https://github.com/sergiodxa/remix-utils)' [`ClientOnly` component](https://github.com/sergiodxa/remix-utils#clientonly).
17+
Because `react-quill` uses `window` features under the hood, you should create a wrapper with [`remix-utils`](https://github.com/sergiodxa/remix-utils)' [`ClientOnly` component](https://github.com/sergiodxa/remix-utils#clientonly).
1818

1919
## Related Links
2020

react-quill/app/components/textEditor.client.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import type { ComponentProps } from "react";
22
import ReactQuill from "react-quill";
33

44
type ReactQuillProps = ComponentProps<typeof ReactQuill>;
5-
type Props = Pick<ReactQuillProps, 'name' | 'onChange' | 'placeholder' | 'theme' | 'value'>;
5+
type Props = Pick<
6+
ReactQuillProps,
7+
"name" | "onChange" | "placeholder" | "theme" | "value"
8+
>;
69

710
const toolBarOptions = {
811
toolbar: [
@@ -21,7 +24,5 @@ const toolBarOptions = {
2124
};
2225

2326
export function TextEditor(props: Props) {
24-
return (
25-
<ReactQuill {...props} modules={toolBarOptions} />
26-
);
27+
return <ReactQuill {...props} modules={toolBarOptions} />;
2728
}

react-quill/app/routes/index.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { json } from "@remix-run/node";
2-
import type { ActionArgs, LinksFunction } from '@remix-run/node';
2+
import type { ActionArgs, LinksFunction } from "@remix-run/node";
33
import { Form } from "@remix-run/react";
44
import { useState } from "react";
55
import stylesheetQuill from "react-quill/dist/quill.snow.css";
@@ -10,12 +10,12 @@ import { TextEditor } from "~/components/textEditor.client";
1010

1111
export const links: LinksFunction = () => {
1212
return [{ rel: "stylesheet", href: stylesheetQuill }];
13-
}
13+
};
1414

15-
export const action = async ({ request }: ActionArgs) => {
15+
export const action = async ({ request }: ActionArgs) => {
1616
const form = await request.formData();
1717
const textEditorValue = form.get("textEditor");
18-
return json({textEditorValue});
18+
return json({ textEditorValue });
1919
};
2020

2121
export default function Index() {
@@ -32,11 +32,7 @@ export default function Index() {
3232
/>
3333
)}
3434
</ClientOnly>
35-
<input
36-
type="hidden"
37-
name="textEditor"
38-
value={textEditor}
39-
/>
35+
<input type="hidden" name="textEditor" value={textEditor} />
4036
<br />
4137
<button type="submit">Submit</button>
4238
</Form>

0 commit comments

Comments
 (0)