diff --git a/examples/with-cerebral/components/Clock.js b/examples/with-cerebral/components/Clock.js
index cfbddeae67ab19e..e2f4fcc8a3c31e3 100644
--- a/examples/with-cerebral/components/Clock.js
+++ b/examples/with-cerebral/components/Clock.js
@@ -1,3 +1,7 @@
+const pad = (n) => (n < 10 ? `0${n}` : n)
+const format = (t) =>
+ `${pad(t.getUTCHours())}:${pad(t.getUTCMinutes())}:${pad(t.getUTCSeconds())}`
+
export default function Clock(props) {
return (
@@ -18,8 +22,3 @@ export default function Clock(props) {
)
}
-
-const format = (t) =>
- `${pad(t.getUTCHours())}:${pad(t.getUTCMinutes())}:${pad(t.getUTCSeconds())}`
-
-const pad = (n) => (n < 10 ? `0${n}` : n)
diff --git a/examples/with-cxs/pages/index.js b/examples/with-cxs/pages/index.js
index bc7e660e5b2383e..fe092135537374c 100644
--- a/examples/with-cxs/pages/index.js
+++ b/examples/with-cxs/pages/index.js
@@ -8,14 +8,6 @@ if (typeof window !== 'undefined') {
cxs.rehydrate(serverCss)
}
-export default function Home() {
- return (
-
-
My page
-
- )
-}
-
const cx = {
root: cxs({
width: 80,
@@ -35,3 +27,11 @@ const cx = {
},
}),
}
+
+export default function Home() {
+ return (
+
+
My page
+
+ )
+}
diff --git a/examples/with-draft-js/pages/index.js b/examples/with-draft-js/pages/index.js
index 950f5b4aceaa731..3185ad29e701f55 100644
--- a/examples/with-draft-js/pages/index.js
+++ b/examples/with-draft-js/pages/index.js
@@ -7,6 +7,81 @@ import {
convertFromRaw,
} from 'draft-js'
+const initialData = {
+ blocks: [
+ {
+ key: '16d0k',
+ text: 'You can edit this text.',
+ type: 'unstyled',
+ depth: 0,
+ inlineStyleRanges: [{ offset: 0, length: 23, style: 'BOLD' }],
+ entityRanges: [],
+ data: {},
+ },
+ {
+ key: '98peq',
+ text: '',
+ type: 'unstyled',
+ depth: 0,
+ inlineStyleRanges: [],
+ entityRanges: [],
+ data: {},
+ },
+ {
+ key: 'ecmnc',
+ text: 'Luke Skywalker has vanished. In his absence, the sinister FIRST ORDER has risen from the ashes of the Empire and will not rest until Skywalker, the last Jedi, has been destroyed.',
+ type: 'unstyled',
+ depth: 0,
+ inlineStyleRanges: [
+ { offset: 0, length: 14, style: 'BOLD' },
+ { offset: 133, length: 9, style: 'BOLD' },
+ ],
+ entityRanges: [],
+ data: {},
+ },
+ {
+ key: 'fe2gn',
+ text: '',
+ type: 'unstyled',
+ depth: 0,
+ inlineStyleRanges: [],
+ entityRanges: [],
+ data: {},
+ },
+ {
+ key: '4481k',
+ text: 'With the support of the REPUBLIC, General Leia Organa leads a brave RESISTANCE. She is desperate to find her brother Luke and gain his help in restoring peace and justice to the galaxy.',
+ type: 'unstyled',
+ depth: 0,
+ inlineStyleRanges: [
+ { offset: 34, length: 19, style: 'BOLD' },
+ { offset: 117, length: 4, style: 'BOLD' },
+ { offset: 68, length: 10, style: 'ANYCUSTOMSTYLE' },
+ ],
+ entityRanges: [],
+ data: {},
+ },
+ ],
+ entityMap: {},
+}
+
+// Custom overrides for each style
+const styleMap = {
+ CODE: {
+ backgroundColor: 'rgba(0, 0, 0, 0.05)',
+ fontFamily: '"Inconsolata", "Menlo", "Consolas", monospace',
+ fontSize: 16,
+ padding: 4,
+ },
+ BOLD: {
+ color: '#395296',
+ fontWeight: 'bold',
+ },
+ ANYCUSTOMSTYLE: {
+ color: '#00e400',
+ },
+}
+
export default class App extends Component {
constructor(props) {
super(props)
@@ -223,23 +298,6 @@ export default class App extends Component {
}
}
-// Custom overrides for each style
-const styleMap = {
- CODE: {
- backgroundColor: 'rgba(0, 0, 0, 0.05)',
- fontFamily: '"Inconsolata", "Menlo", "Consolas", monospace',
- fontSize: 16,
- padding: 4,
- },
- BOLD: {
- color: '#395296',
- fontWeight: 'bold',
- },
- ANYCUSTOMSTYLE: {
- color: '#00e400',
- },
-}
-
class ToolbarButton extends Component {
constructor() {
super()
@@ -285,61 +343,3 @@ const ToolBar = (props) => {
)
}
-
-const initialData = {
- blocks: [
- {
- key: '16d0k',
- text: 'You can edit this text.',
- type: 'unstyled',
- depth: 0,
- inlineStyleRanges: [{ offset: 0, length: 23, style: 'BOLD' }],
- entityRanges: [],
- data: {},
- },
- {
- key: '98peq',
- text: '',
- type: 'unstyled',
- depth: 0,
- inlineStyleRanges: [],
- entityRanges: [],
- data: {},
- },
- {
- key: 'ecmnc',
- text: 'Luke Skywalker has vanished. In his absence, the sinister FIRST ORDER has risen from the ashes of the Empire and will not rest until Skywalker, the last Jedi, has been destroyed.',
- type: 'unstyled',
- depth: 0,
- inlineStyleRanges: [
- { offset: 0, length: 14, style: 'BOLD' },
- { offset: 133, length: 9, style: 'BOLD' },
- ],
- entityRanges: [],
- data: {},
- },
- {
- key: 'fe2gn',
- text: '',
- type: 'unstyled',
- depth: 0,
- inlineStyleRanges: [],
- entityRanges: [],
- data: {},
- },
- {
- key: '4481k',
- text: 'With the support of the REPUBLIC, General Leia Organa leads a brave RESISTANCE. She is desperate to find her brother Luke and gain his help in restoring peace and justice to the galaxy.',
- type: 'unstyled',
- depth: 0,
- inlineStyleRanges: [
- { offset: 34, length: 19, style: 'BOLD' },
- { offset: 117, length: 4, style: 'BOLD' },
- { offset: 68, length: 10, style: 'ANYCUSTOMSTYLE' },
- ],
- entityRanges: [],
- data: {},
- },
- ],
- entityMap: {},
-}
diff --git a/examples/with-edgedb/pages/api/post/[id].ts b/examples/with-edgedb/pages/api/post/[id].ts
index 32aa946615b929f..a1971a52bc0e3ef 100644
--- a/examples/with-edgedb/pages/api/post/[id].ts
+++ b/examples/with-edgedb/pages/api/post/[id].ts
@@ -1,23 +1,6 @@
import type { NextApiRequest, NextApiResponse } from 'next'
import { client, e } from '../../../client'
-export default async function handle(
- req: NextApiRequest,
- res: NextApiResponse
-) {
- const postId = req.query.id as string
-
- if (req.method === 'DELETE') {
- res.json(await deletePost(postId))
- } else if (req.method === 'PATCH') {
- res.json(await updatePost(postId, req.body))
- } else {
- throw new Error(
- `The HTTP ${req.method} method is not supported at this route.`
- )
- }
-}
-
// PATCH /api/post/:id
async function updatePost(
postId: string,
@@ -42,3 +25,20 @@ async function deletePost(postId: string) {
}))
.run(client)
}
+
+export default async function handle(
+ req: NextApiRequest,
+ res: NextApiResponse
+) {
+ const postId = req.query.id as string
+
+ if (req.method === 'DELETE') {
+ res.json(await deletePost(postId))
+ } else if (req.method === 'PATCH') {
+ res.json(await updatePost(postId, req.body))
+ } else {
+ throw new Error(
+ `The HTTP ${req.method} method is not supported at this route.`
+ )
+ }
+}
diff --git a/examples/with-expo-typescript/pages/index.tsx b/examples/with-expo-typescript/pages/index.tsx
index a833b7b6d98ae3f..61d3eba5202f577 100644
--- a/examples/with-expo-typescript/pages/index.tsx
+++ b/examples/with-expo-typescript/pages/index.tsx
@@ -2,14 +2,6 @@
import React from 'react'
import { StyleSheet, Text, View } from 'react-native'
-export default function App() {
- return (
-