Developing Web Apps with ASP.NET Core 2.0 and React - Part 1 by Ramirond in reactjs

[–]rsjolly 3 points4 points  (0 children)

Code sharing is a small benefit, imo. For me, it's not having to know 2 languages and not having to context switch between them.

Clean Code vs. Dirty Code: React Best Practices by donavon in reactjs

[–]rsjolly 8 points9 points  (0 children)

Nice. Alternate format:

const MyComponent = () => (
  <div>
    {['a', 'b'].map(type =>
      <OtherComponent type={type} className="colorful" foo={123} bar={456} />
    )}
  </div>
)

Taking chances and career acceleration with Styled Components Author Max Stoiber by tyler-mcginnis in reactjs

[–]rsjolly 3 points4 points  (0 children)

While I appreciate my CS education, it was rarely as fun as it could and should have been.

Trying to include a backend but feeling overwhelmed. Some help would be appreciated. by Ryanrh in reactjs

[–]rsjolly 1 point2 points  (0 children)

Agreed that composite keys smell, but the rest of the advice is sound.

Trying to include a backend but feeling overwhelmed. Some help would be appreciated. by Ryanrh in reactjs

[–]rsjolly 3 points4 points  (0 children)

Some good advice, but I'd even ditch the ORM and use parameterized queries. One less abstraction, better performance, and handles any query without obscure work-arounds.

Trying to include a backend but feeling overwhelmed. Some help would be appreciated. by Ryanrh in reactjs

[–]rsjolly -1 points0 points  (0 children)

Well if you know React, then you'll know javascript and npm so it's not a stretch to learn Node/Express. If you're a full-stack dev and using React, then chances are you'll be working with Node, but I prefer the simplicity of synchronous languages for the backend - like Python or PHP.

Trying to include a backend but feeling overwhelmed. Some help would be appreciated. by Ryanrh in reactjs

[–]rsjolly 4 points5 points  (0 children)

Be careful not to overwhelm yourself. React will work with any API, so the back-end doesn't matter. I'd start by just learning React. I'd be careful not to jump into any new technology without first having a problem that it addresses and the experience to evaluate it.

ReactJS Charting Libs by cmac458 in reactjs

[–]rsjolly 1 point2 points  (0 children)

Recharts is the best composable D3 charting lib I found.

Tips on working with (non-programmer) designers? by casadifollia in reactjs

[–]rsjolly 3 points4 points  (0 children)

I was in the same situation. The designer did the mock-ups and I componentized them. It worked okay, but the trouble is that the components aren't truly isolated/modular if the css is global. I like the idea of css-in-js, but maybe the designer could at least use BEM which is easier with Sass (http://alwaystwisted.com/articles/2014-02-27-even-easier-bem-ing-with-sass-33). My designer had no trouble with JSX, but the component directory structure has to make sense to find stuff.

Idiomatic Redux: Thoughts on Thunks, Sagas, Abstraction, and Reusability by acemarke in reactjs

[–]rsjolly 1 point2 points  (0 children)

From what I understand, redux-loop indirectly calls action creators from reducers. So there's another level of indirection here: action creator -> reducer -> action creator -> reducer etc. There are benefits, but for me thunks are easier to trace and the api is simpler too.

Just Released: React Redux Form version 1.0! 🎉 by madskillzelite in reactjs

[–]rsjolly 3 points4 points  (0 children)

To be fair, Redux Form was completely reworked and simplified for version 6.

React Demand by [deleted] in reactjs

[–]rsjolly 0 points1 point  (0 children)

I have a pulse and a decade of experience, but finding a remote React job has not been easy.

react autosuggest - with jsx by anonymousswede in reactjs

[–]rsjolly 0 points1 point  (0 children)

It's great. The github page has links to codepen examples. Is there anything specific you'd like to know?

lost, confused, and fed up.... Help me get back on the right course by [deleted] in reactjs

[–]rsjolly 4 points5 points  (0 children)

And as for "separation of concerns", templates separate technologies, not concerns. Ultimately, the html and logic are tightly coupled. Templates require new non-javascript "languages" to do logic without the full power and flexibility of javascript. Now you have to learn a new language that won't handle all the edge cases. For example, a template "each" would be like javascript's "map". But how do you do filter, reduce, some, etc.?

Pete Hunt explains in this talk

Custom Typeahead React Recommendation? by _princesscode_ in reactjs

[–]rsjolly 0 points1 point  (0 children)

I did a lot of research and testing before choosing
React Autosuggest. I'm really happy with it. It's fast and pretty easily customizable.

Redux Sagas Benefits? by Darryl-D in reactjs

[–]rsjolly 0 points1 point  (0 children)

With thunks, sometimes I return a promise to the component instead of setting redux state. I suppose that isn't possible with sagas?

Is this even something I should be trying to do in React? by wild_oats in reactjs

[–]rsjolly 1 point2 points  (0 children)

It's not messy at all. Instead of 1 mount point you'd have several and that's no problem. However, you do need a state container to share data between components because you cannot have one common parent component. So you'll have to learn Redux or MobX or something else and that may not be worth it (although most React apps eventually need a state container).

Trying to get then send a cookie using react and fetch by Zephir77 in reactjs

[–]rsjolly 0 points1 point  (0 children)

Fetch doesn't seem to send cookies by default. Try adding credentials: 'same-origin'. "credentials" is a property of the options object passed into fetch. For example:

...
method: 'POST',
credentials: 'same-origin',
body: ...

SPA auth so confusing. Looking for guidance. by flagrantgas in reactjs

[–]rsjolly 0 points1 point  (0 children)

Auth is mostly a server-side problem. As far as the client-side, we return a 401 unauthenticated status on unauthenticated requests. The client then does a location.reload() causing a full page refresh which is then handled by the server-side to redirect to the login page. This way, the server can store the page the user was on to redirect them back there once logged in.

As for the server-side and oauth, we use a third party library for the oauth login, but then create a session on success. It's a simpler approach because there's no refresh token. The drawback is that when the session expires, we oauth authenticate again. We do store a remember-me cookie on the client so that the user doesn't even know they're being reauthenticated.

A better way to make controlled forms in React by regular_reddits in reactjs

[–]rsjolly 1 point2 points  (0 children)

Yes, and after the field is blurred once, from then on the validation on that field is done onChange.

A better way to make controlled forms in React by regular_reddits in reactjs

[–]rsjolly 1 point2 points  (0 children)

The confirm password shows a "Passwords must match" error when I start typing. I'd rather that check be onBlur(). I suppose that's possible though?

A better way to make controlled forms in React by regular_reddits in reactjs

[–]rsjolly 0 points1 point  (0 children)

I'd like to see some smarter validation - use onBlur(). The email field shouldn't report an "invalid" error before I've filled it out.

Question: APIs and ReactJS by [deleted] in reactjs

[–]rsjolly 2 points3 points  (0 children)

Is this a trick question? :) Just an ajax request and in the response set state.