Skip to content
This repository has been archived by the owner on Sep 8, 2021. It is now read-only.

Update to React 16.9 and Hooks #140

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

shanebdavis
Copy link

@shanebdavis shanebdavis commented Sep 13, 2019

I went through all the components and updated them to React 16.9 using hooks. No more classes. Reduced code somewhat.

@dabonnestor
Copy link

You mean 16.9? not 12.9

@shanebdavis shanebdavis changed the title Update to React 12.9 and Hooks Update to React 16.9 and Hooks Sep 18, 2019
@shanebdavis
Copy link
Author

You mean 16.9? not 12.9

OMG yes! Thanks!

@shanebdavis
Copy link
Author

shanebdavis commented Sep 19, 2019

I'd like to merge my work with pull-request #135 , but I'm going to hold off until it is accepted into the main repo.

@bluedusk
Copy link

If I'm not running it wrongly, this is breaking if you go to New Post it will keep firing:


 action EDITOR_PAGE_LOADED @ 13:47:14.096
redux-logger.js:1  prev state {article: {…}, articleList: {…}, auth: {…}, common: {…}, editor: {…}, …}
redux-logger.js:1  action     {type: "EDITOR_PAGE_LOADED", payload: null}
redux-logger.js:1  next state {article: {…}, articleList: {…}, auth: {…}, common: {…}, editor: {…}, …}
redux-logger.js:1  action EDITOR_PAGE_UNLOADED @ 13:47:14.102
redux-logger.js:1  prev state {article: {…}, articleList: {…}, auth: {…}, common: {…}, editor: {…}, …}
redux-logger.js:1  action     {type: "EDITOR_PAGE_UNLOADED"}

And the form is not editable.

@shanebdavis
Copy link
Author

If I'm not running it wrongly, this is breaking if you go to New Post it will keep firing:
[...] And the form is not editable.

Thanks! I'll take a look.

@ghost
Copy link

ghost commented Oct 10, 2019

In the Editor.js the second useEffect needs an empty array as the second argument.

useEffect(() => { if (props.match.params.slug) { return props.onLoad(agent.Articles.get(props.match.params.slug)); } props.onLoad(null); return () => props.onUnload(); }, []);

@ghost
Copy link

ghost commented Oct 10, 2019

Also in the Editor.js
value={props.title || ''}
value={props.description || ''}
value={props.body || ''}
value={props.tagInput || ''}
|| '' was missing from the input.

@ghost
Copy link

ghost commented Oct 10, 2019

In the Settings.js we have similar missing || '' on the inputs.
Looking good otherwise.

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

Successfully merging this pull request may close these issues.

None yet

3 participants