Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nextjs #55

Open
markolofsen opened this issue Oct 27, 2018 · 1 comment
Open

Nextjs #55

markolofsen opened this issue Oct 27, 2018 · 1 comment

Comments

@markolofsen
Copy link

markolofsen commented Oct 27, 2018

Can you show example your slate with Next.js?
Markdown with Toolbar and serialize/deserializer into Markdown (or HTML) format

My sample doesn't work:

// @flow
import React from "react";
import ReactDOM from "react-dom";


import { Value } from "slate";
import Editor from "slate-md-editor";



const initialValue = Value.fromJSON({
  document: {
    nodes: [
      {
        object: "block",
        type: "paragraph",
        nodes: [
          {
            object: "text",
            leaves: [
              {
                text: "A line of text in a paragraph."
              }
            ]
          }
        ]
      }
    ]
  }
});

class DemoEditor extends React.Component {
  // Set the initial state when the app is first constructed.
  state = {
    value: initialValue
  };

  render() {
    const { value } = this.state;
    const onChange = ({ value }) => this.setState({ value });

    return (
      <div style={{ margin: "20px" }}>
        <Editor value={value} onChange={this.onChange} />;
      </div>
    );
  }
}

export default DemoEditor

@sukechris
Copy link

@markolofsen Hi, have you solved this problem? Any help would be appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants