How we combine React, Next.js, GraphQL, Apollo, and Ruby on Rails
The way I structure React applications for the last couple of years. The focus is on decoupling and making it obvious what is used where.
How sometimes is better to split React component into two than adding more props.
How I structure, React components at Product Hunt. The following component a directory pattern and optimizing for scanability.
The story of technical failure at Product Hunt. We used Slate for an HTML editor and tightly coupled its internal structure to our database.
I get a lot of questions about how I'm using React.Context. A lot of people overuse it, and their applications become messy. Here are my tips.
How to extract custom React hooks to refactor complicated logic in your components.
This is one of my favorite refactorings. It helps to group logic, making code easier to read and easier to extend.
At the time of this writing, our codebase and related projects have 222 mutations. Here the guide on structuring GraphQL mutations.
How to build a React component which takes the text with URLs and adds links there. It uses a little known string.split feature.
Here is a recap of what happened during the conference ? ⚛️
How to handle backend permissions and authorization rules in GraphQL, by exposing flags fields.
How to handle load more buttons with GraphQL and Apollo.
The (not a) conference would be held 28th April at The Generator (Sofia, Bulgaria). It is free to attend. ⚛️?
GraphQL's built-in mechanism for errors doesn't play well with forms. This is how I deal with form errors and GraphQL.
Couple of minor tricks, which makes testing react components easier and future proved.
Almost every feature in Product Hunt starts with a feature flag. Here is how to have feature flags with React.
React Router uses the Link component for specifying url. This string works but doesn't protect us from mistyping and other issues.
Why using Flow is better than user React.PropTypes for handing prop validations.
A better approach for selecting elements during testing, than using custom class names.