-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Re-write DraftEditorExample
in the website using react hooks
#2287
Conversation
Also took the oportunity to clean up the component- it had unused imports and `_handleKeyCommand` was returning a boolean instead of `"handled"` and `"not-handled"`. `yarn && yarn start`, used the editor.
Good job! What about integrating the repo with something like Zeit to deploy the PR for easier testing? Hey @yangshun how did you do that for your Docusaurus 2 PR, did you deploy manually to now.sh? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just a nit on the name of the focus
function 😅
_toggleBlockType(blockType) { | ||
this.onChange(RichUtils.toggleBlockType(this.state.editorState, blockType)); | ||
} | ||
const focus = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: can you rename to focusEditor
? This is shadowing the window.focus()
method
@claudiopro We use Netlify previews. However, Netlify is recently tighten its free tier limits so it might not be that viable as an option. You could check out Netlify or Now. |
@mrkev I don't want to block on this, let's land as-is and fix forward |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@claudiopro is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@claudiopro merged this pull request in 9b9376b. |
…ookarchive#2287) Summary: Also took the oportunity to clean up the component- it had unused imports and `_handleKeyCommand` was returning a boolean instead of `"handled"` and `"not-handled"`. `yarn && yarn start`, used the editor. Pull Request resolved: facebookarchive#2287 Differential Revision: D19598449 Pulled By: claudiopro fbshipit-source-id: 275ef520c10f941236138211c8eb572c6df28f9d
…ookarchive#2287) Summary: Also took the oportunity to clean up the component- it had unused imports and `_handleKeyCommand` was returning a boolean instead of `"handled"` and `"not-handled"`. `yarn && yarn start`, used the editor. Pull Request resolved: facebookarchive#2287 Differential Revision: D19598449 Pulled By: claudiopro fbshipit-source-id: 275ef520c10f941236138211c8eb572c6df28f9d
Summary: Also took the oportunity to clean up the component- it had unused imports and `_handleKeyCommand` was returning a boolean instead of `"handled"` and `"not-handled"`. `yarn && yarn start`, used the editor. Pull Request resolved: facebookarchive/draft-js#2287 Differential Revision: D19598449 Pulled By: claudiopro fbshipit-source-id: 275ef520c10f941236138211c8eb572c6df28f9d
Also took the oportunity to clean up the component- it had unused imports and
_handleKeyCommand
was returning a boolean instead of"handled"
and"not-handled"
.yarn && yarn start
, used the editor.