Summary explainer: facebook/react#20031 (comment)
Input:
<ComponentA />;
<ComponentD prop="A" key="K" />;
<ComponentB {...props} />;
;
Summary explainer: facebook/react#20031 (comment)
Input:
<ComponentA />;
<ComponentD prop="A" key="K" />;
<ComponentB {...props} />;
;
The package that linked you here is now pure ESM. It cannot be require()
'd from CommonJS.
This means you have the following choices:
import foo from 'foo'
instead of const foo = require('foo')
to import the package. You also need to put "type": "module"
in your package.json and more. Follow the below guide.await import(…)
from CommonJS instead of require(…)
.Firstly, Create React App is good. But it's a very rigid CLI, primarily designed for projects that require very little to no configuration. This makes it great for beginners and simple projects but unfortunately, this means that it's pretty non-extensible. Despite the involvement from big names and a ton of great devs, it has left me wanting a much better developer experience with a lot more polish when it comes to hot reloading, babel configuration, webpack configuration, etc. It's definitely simple and good, but not amazing.
Now, compare that experience to Next.js which for starters has a much larger team behind it provided by a world-class company (Vercel) who are all financially dedicated to making it the best DX you could imagine to build any React application. Next.js is the 💣-diggity. It has amazing docs, great support, can grow with your requirements into SSR or static site generation, etc.
(I'm enjoying doing these raw, barely edited writeups; I hope they're useful to you too)
This is my own writeup on feature flags; for a deep dive I'd recommend something like Martin Fowler's article (https://martinfowler.com/articles/feature-toggles.html).
So. Feature flags. The basic idea that you'll store configuration/values on a database/service somewhere, and by changing those values, you can change the user experience/features for a user on the fly.
Let's say that you're building a new feature, called 'new-button' which changes the color of buttons, which is currently red, to blue. Then you'd change code that looks like this -
import MomentUtils from '@date-io/moment'; | |
class MomentUTCUtils extends MomentUtils { | |
format(value, formatString) { | |
return this.moment.utc(value).format(formatString); | |
} | |
parse(value: string, format: string) { | |
if (value === '') { | |
return null; |
invoices/123
?
in a URL like /assignments?showGrades=1
.#
portion of the URL. This is not available to servers in request.url
so its client only. By default it means which part of the page the user should be scrolled to, but developers use it for various things.https://twitter.com/snookca/status/1073299331262889984?s=21
Happy to chat about this. There’s an obvious disclaimer that there’s a cost to css-in-js solutions, but that cost is paid specifically for the benefits it brings; as such it’s useful for some usecases, and not meant as a replacement for all workflows.
(These conversations always get heated on twitter, so please believe that I’m here to converse, not to convince. In return, I promise to listen to you too and change my opinions; I’ve had mad respect for you for years and would consider your feedback a gift. Also, some of the stuff I’m writing might seem obvious to you; I’m not trying to tell you if all people of some of the details, but it might be useful to someone else who bumps into this who doesn’t have context)
So the big deal about css-in-js (cij) is selectors.
<!doctype html> | |
<html lang="en"> | |
<body> | |
<script> | |
const sagaMiddleware = store => gen => { | |
var resolve, reject | |
var done = new Promise((res, rej) => { | |
resolve = res |
// connect() is a function that injects Redux-related props into your component. | |
// You can inject data and callbacks that change that data by dispatching actions. | |
function connect(mapStateToProps, mapDispatchToProps) { | |
// It lets us inject component as the last step so people can use it as a decorator. | |
// Generally you don't need to worry about it. | |
return function (WrappedComponent) { | |
// It returns a component | |
return class extends React.Component { | |
render() { | |
return ( |