markerikson/react-redux-links

Refactoring: split up React Component Patterns

markerikson opened this issue ยท 10 comments

The React Component Patterns page has gotten really large, and is probably due to be split up into smaller pages.

The first step would be to extract the "Higher Order Components" and "Composing Components with Functional Programming" subcategories into a new page called "React Component Composition", and split up the "HOC" subcategory into separate subcategories for HOCs and render prop/function-as-a-child info.

So, the new page would look like:

  • React Component Composition
    • Higher-Order Components
    • Render Props
    • Functional Composition

We'd then need to add links to those categories back into the top of the "React Component Patterns" page, and add anchor tags so that any external links to react-component-patterns.md#higher-order-components would auto-scroll to have the link at the top of the page.

Finally, the Table of Contents in the README would need to have the new page added as a list item underneath the "React Component Patterns" entry.

I can take a look at this.

@john-d-pelingo : cool, thanks! Please feel free to fork and file a PR, and let me know if you have any questions.

Looks like there are 3 cases where both Higher-Order Components and Render Props are discussed together.

Functions as Child Components and Higher Order Components
Simplifying life with React render callbacks
"HOCs vs render callbacks / function-as-child"

Where should each go?

Good question. Perhaps there could be a "Comparing Composition Approaches" sub-category? Also, Michael Jackson's Never Write Another HoC talk would be a great fit for that section too.

Good idea. Will put the new sub-category below Function Composition along with the new link.

Closed by #72 .

@john-d-pelingo : thank you VERY much for helping with this! I probably need to find some time to figure out what other cleanup and reorganization work I'd like done with this list.

If you're really bored, I've got some ideas for reorganizing and splitting up sections in my Redux addons catalog as well :)

Hmm. I thought that would actually work. I know I put anchors like that into the Redux FAQ, but that gets built into static HTML and not served directly by Github. Oh, well. I may play with it later.

I'm down for reorganising and splitting up sections of your other redux repo. Whenever you can, post an issue there just like this one with a list of checkboxes. I'm thinking that it's going to be way bigger than this one.

Cool, thanks! I just created three issues over there for refactoring the "Reducers", "Action/Reducer Generator", and "Variations" pages. "Reducers" would be my first priority. Feel free to start tackling that one, and thanks for the help!