Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Adding Hooks in docs #2004

Closed
wants to merge 4 commits into from
Closed

Adding Hooks in docs #2004

wants to merge 4 commits into from

Conversation

charliewilco
Copy link
Contributor

Adds React Hooks as examples in docs #1987

@mrkev
Copy link
Contributor

mrkev commented Apr 1, 2019

The second example works, but I tried the first one on CodeSandbox and it didn't quite work. I'm happy to add it if we can get this going.

@charliewilco
Copy link
Contributor Author

doh! editor.current.focus()

@mrkev
Copy link
Contributor

mrkev commented Apr 4, 2019

ah, classic! 😄 Alright, I think this looks good to go.

Copy link

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrkev has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@claudiopro claudiopro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing this improvement @charliewilco! Please look into these nits if possible, as inline JS in markdown is not (yet) formatted by Prettier 😅

README.md Outdated

React.useEffect(() => {
focusEditor()
}, [])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: missing semicolon

README.md Outdated
EditorState.createEmpty()
);

const editor = React.useRef(null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: missing semicolon

@charliewilco
Copy link
Contributor Author

should be resolved, sorry about that! i thought prettier would do js in markdown blocks https://prettier.io/blog/2017/11/07/1.8.0.html

Copy link

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrkev has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link

@claudiopro merged this pull request in f9f5fd6.

jdecked pushed a commit to twitter-forks/draft-js that referenced this pull request Oct 9, 2019
Summary:
Adds React Hooks as examples in docs facebookarchive#1987
Pull Request resolved: facebookarchive#2004

Reviewed By: claudiopro

Differential Revision: D14783281

Pulled By: claudiopro

fbshipit-source-id: 7edcdb3ee4e32afd1197ea69fed968538243eccd
mmissey pushed a commit to mmissey/draft-js that referenced this pull request Mar 24, 2020
Summary:
Adds React Hooks as examples in docs facebookarchive#1987
Pull Request resolved: facebookarchive#2004

Reviewed By: claudiopro

Differential Revision: D14783281

Pulled By: claudiopro

fbshipit-source-id: 7edcdb3ee4e32afd1197ea69fed968538243eccd
alicayan008 pushed a commit to alicayan008/draft-js that referenced this pull request Jul 4, 2023
Summary:
Adds React Hooks as examples in docs #1987
Pull Request resolved: facebookarchive/draft-js#2004

Reviewed By: claudiopro

Differential Revision: D14783281

Pulled By: claudiopro

fbshipit-source-id: 7edcdb3ee4e32afd1197ea69fed968538243eccd
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants