Skip to content

Sync with reactjs.org @ 0bb0303f #226

New issue

Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “No Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? No Sign in to your account

Merged
merged 61 commits into from
Jul 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
54a331d
Mention useReducer as a cause of rerender in React.memo (#3576)
compulim Mar 12, 2021
df2fbde
Fix typos in error-boundaries.md (#3586)
jmtes Mar 22, 2021
f5784cb
Use React 17.0.2 (#3590)
gaearon Mar 22, 2021
8aee286
Testing Recipes - Timers: call useFakeTimers/userRealTimers before/af…
Pradip-Khakurel Mar 23, 2021
7626d6c
Add Chile Meetup Group (#3584)
OliverPradaLara Mar 23, 2021
c970f75
Fix 404 broken link for createFragmentContainer (#3598)
mvikrammenon Mar 26, 2021
c9efa5e
Correct grammar (#3608)
Apr 5, 2021
49fd7d5
Update reference-caveats-solution.js (#3609)
niklasp Apr 5, 2021
3bff1ac
update on RN and react 17 (#3620)
pvinis Apr 8, 2021
968f091
update Optimizing Performance section (#3605) (#3623)
ethanyang163 Apr 12, 2021
cf0f0f9
docs: Fix broken links to React Conf videos (#3629)
orama254 Apr 14, 2021
cde1783
docs: Add react learning path on frontend masters link (#3628)
orama254 Apr 15, 2021
446345c
fixing typo in tutorial readme (#3639)
nancyheiss Apr 16, 2021
8e0ed8f
Removed createBlockingRoot API docs and added a warning note (#3642)
Apr 19, 2021
420c397
Update code-splitting.md (setup → set up) (#3643)
Apr 20, 2021
8251eab
`lifecycle` -> `lifecycle method` (#3650)
danield770 Apr 22, 2021
5119600
Include where `setState` is comming from (#3652)
m019m1 Apr 22, 2021
c3c93e2
added hyperlink for Netlify (#3445)
nkalinos Apr 27, 2021
16158f1
Update devtools screenshot to latest version (#3670)
skaidra-bake May 6, 2021
5201abf
Bump lodash from 4.17.20 to 4.17.21 (#3680)
dependabot[bot] May 12, 2021
12b08e4
Update addons-test-utils.md (#3660)
intrepidOlivia May 14, 2021
abcf035
Add React Advanced London 2021 - in-person + remote (#3686)
robhrt7 May 14, 2021
a5e0bf4
grammatical typo fix on allowlist (#3689)
khjabir May 19, 2021
e60bca0
Fixed a minor typo in a comment (#3685)
omasher May 21, 2021
91cfb4e
Change example to use a <form> (#3697)
gaearon May 25, 2021
f6c2e06
Bump browserslist from 4.14.3 to 4.16.6 (#3699)
dependabot[bot] May 26, 2021
ec2d0ad
Updating name of variable to which returned value of setState is assi…
avinasx May 28, 2021
6618bcc
Fix broken link to devtools (#3715)
tupini07 May 31, 2021
ff68780
Fixed typo inside concurrent-mode-reference.md (#3716)
tfrank11 May 31, 2021
68e4efc
Added missing comma and removed a few redundant words (#3725)
lukeingalls Jun 7, 2021
6e6500e
Add React Conference Live 2021 (#3718)
lauragift21 Jun 8, 2021
7b0aecb
New post: The Plan for React 18 (#3729)
acdlite Jun 8, 2021
95ea219
Fix hanging word
gaearon Jun 8, 2021
589c033
Add /link/switch-to-createroot (#3730)
acdlite Jun 9, 2021
bb3702d
Bump dns-packet from 1.3.1 to 1.3.4 (#3700)
dependabot[bot] Jun 13, 2021
f3baa6d
Bump ws from 5.2.2 to 5.2.3 (#3735)
dependabot[bot] Jun 13, 2021
07e58b4
Fix typo in optimizing-performance (#3746)
samchillcott Jun 22, 2021
d474763
Updated next/experimental release version docs (#3748)
Jun 23, 2021
25f756d
Update outdated link on Static Type Checking page
lex111 Jun 26, 2021
d456dfb
Update docs and config to replace "master" with "main" branch
Jun 29, 2021
1a5491f
Update react India 2021 date and location (#3750)
apherio Jun 30, 2021
0c2edd9
Add link to podcast "The React Native Show" (#3738)
jaworek Jun 30, 2021
1a4e21a
Fix broken link in the web-components.md file (#3761)
gabrielkuhn Jul 1, 2021
2da06a7
Fix broken Props vs State link (#3765)
Laffini Jul 4, 2021
89f3470
Fix broken link in the MarkdownPage.js file (#3764)
sanketshah19 Jul 4, 2021
0bb0303
Update Static Typing Section (Reason -> ReScript) (#3766)
ryyppy Jul 5, 2021
40fdf2a
merging all conflicts
reactjs-translation-bot Jul 5, 2021
2c725a3
Update package.json
sJJdGG Jul 10, 2021
630cf85
Resolve README.md conflict
sJJdGG Jul 10, 2021
d8f8393
Resolve thinking-in-react.md conflict
sJJdGG Jul 10, 2021
9485431
Resolve reference-react.md conflicts
sJJdGG Jul 10, 2021
273df0e
Resolve reference-react-component.md conflicts
sJJdGG Jul 10, 2021
00d2085
Resolve lists-and-keys.md conflicts
sJJdGG Jul 10, 2021
7e3bdd0
Update lifting-state-up.md translation
sJJdGG Jul 10, 2021
d26d5db
Resolve hello-world.md conflicts
sJJdGG Jul 10, 2021
ba0fddb
Update handling-events.md
sJJdGG Jul 10, 2021
1eb436d
Resolve forms.md conflict
sJJdGG Jul 10, 2021
e91d499
Resolve code-splitting.md conflict
sJJdGG Jul 10, 2021
2c3c6c6
Update addons-test-utils.md Translation
sJJdGG Jul 10, 2021
1b2e39e
Update 2020-10-20-react-v17.md Translation
sJJdGG Jul 10, 2021
9fe73d7
Minor changes
sJJdGG Jul 10, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Thank you for the PR! Contributors like you keep React awesome!

Please see the Contribution Guide for guidelines:

https://github.com/reactjs/reactjs.org/blob/master/CONTRIBUTING.md
https://github.com/reactjs/reactjs.org/blob/main/CONTRIBUTING.md

If your PR references an existing issue, please add the issue number below

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,4 @@ yarn dev

<p dir="rtl">
محتوایی که در <a href="https://reactjs.org/">reactjs.org</a> قرار می‌گیرد، تخت مجوز CC-BY-4.0 منتشر می‌شود که جزئیات آن در <a href="https://github.com/open-source-explorer/reactjs.org/blob/master/LICENSE-DOCS.md">LICENSE-DOCS.md</a> آمده‌است.
</p>
</p>
9 changes: 9 additions & 0 deletions content/authors.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Map of short name to more information. `name` will be used but if you don't
# want to use your real name, just use whatever. If url is included, your name
# will be a link to the provided url.
abernathyca:
name: Christine Abernathy
url: https://twitter.com/abernathyca
acdlite:
name: Andrew Clark
url: https://twitter.com/acdlite
Expand Down Expand Up @@ -70,12 +73,18 @@ petehunt:
rachelnabors:
name: Rachel Nabors
url: https://twitter.com/rachelnabors
rickhanlonii:
name: Rick Hanlon
url: https://twitter.com/rickhanlonii
schrockn:
name: Nick Schrock
url: https://twitter.com/schrockn
sebmarkbage:
name: Sebastian Markbåge
url: https://twitter.com/sebmarkbage
sethwebster:
name: Seth Webster
url: https://twitter.com/sethwebster
sophiebits:
name: Sophie Alpert
url: https://sophiebits.com/
Expand Down
2 changes: 1 addition & 1 deletion content/blog/2013-07-03-community-roundup-4.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ Over the past several weeks, members of our team, [Pete Hunt](http://www.petehun

[Tom Occhino](http://tomocchino.com/) implemented Snake in 150 lines with React.

> [Check the source on GitHub](https://github.com/tomocchino/react-snake/blob/master/src/snake.js)
> [Check the source on GitHub](https://github.com/tomocchino/react-snake/blob/main/src/snake.js)
> <figure><a href="https://tomocchino.github.io/react-snake/"><img src="../images/blog/snake.png"></a></figure>
2 changes: 1 addition & 1 deletion content/blog/2013-08-05-community-roundup-6.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ este.demos.react.todoApp = este.react.create (`/** @lends {React.ReactComponent.
]
```

[Check it out on GitHub...](https://github.com/steida/este-library/blob/master/este/demos/thirdparty/react/start.coffee)
[Check it out on GitHub...](https://github.com/steida/este-library/blob/main/este/demos/thirdparty/react/start.coffee)


## React Stylus Boilerplate {#react-stylus-boilerplate}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ Alternatively, add it into your `requirements` file:

**Dependencies**: PyReact uses [PyExecJS](https://github.com/doloopwhile/PyExecJS) to execute the bundled React code, which requires that a JS runtime environment is installed on your machine. We don't explicitly set a dependency on a runtime environment; Mac OS X comes bundled with one. If you're on a different platform, we recommend [PyV8](https://code.google.com/p/pyv8/).

For the initial release, we've only tested on Python 2.7. Look out for support for Python 3 in the future, and if you see anything that can be improved, we welcome your [contributions](https://github.com/facebook/react-python/blob/master/CONTRIBUTING.md)!
For the initial release, we've only tested on Python 2.7. Look out for support for Python 3 in the future, and if you see anything that can be improved, we welcome your [contributions](https://github.com/facebook/react-python/blob/main/CONTRIBUTING.md)!
4 changes: 2 additions & 2 deletions content/blog/2013-08-26-community-roundup-7.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ It's been three months since we open sourced React and it is going well. Some st

## Wolfenstein Rendering Engine Ported to React {#wolfenstein-rendering-engine-ported-to-react}

[Pete Hunt](http://www.petehunt.net/) ported the render code of the web version of Wolfenstein 3D to React. Check out [the demo](http://www.petehunt.net/wolfenstein3D-react/wolf3d.html) and [render.js](https://github.com/petehunt/wolfenstein3D-react/blob/master/js/renderer.js#L183) file for the implementation.
[Pete Hunt](http://www.petehunt.net/) ported the render code of the web version of Wolfenstein 3D to React. Check out [the demo](http://www.petehunt.net/wolfenstein3D-react/wolf3d.html) and [render.js](https://github.com/petehunt/wolfenstein3D-react/blob/main/js/renderer.js#L183) file for the implementation.
<figure><a href="http://www.petehunt.net/wolfenstein3D-react/wolf3d.html"><img src="../images/blog/wolfenstein_react.png"></a></figure>


## React & Meteor {#react--meteor}

[Ben Newman](https://twitter.com/benjamn) made a [13-lines wrapper](https://github.com/benjamn/meteor-react/blob/master/lib/mixin.js) to use React and Meteor together. [Meteor](http://www.meteor.com/) handles the real-time data synchronization between client and server. React provides the declarative way to write the interface and only updates the parts of the UI that changed.
[Ben Newman](https://twitter.com/benjamn) made a [13-lines wrapper](https://github.com/benjamn/meteor-react/blob/main/lib/mixin.js) to use React and Meteor together. [Meteor](http://www.meteor.com/) handles the real-time data synchronization between client and server. React provides the declarative way to write the interface and only updates the parts of the UI that changed.

> This repository defines a Meteor package that automatically integrates the React rendering framework on both the client and the server, to complement or replace the default Handlebars templating system.
>
Expand Down
2 changes: 1 addition & 1 deletion content/blog/2013-10-16-react-v0.5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ author: [zpao]

This release is the result of several months of hard work from members of the team and the community. While there are no groundbreaking changes in core, we've worked hard to improve performance and memory usage. We've also worked hard to make sure we are being consistent in our usage of DOM properties.

The biggest change you'll notice as a developer is that we no longer support `class` in JSX as a way to provide CSS classes. Since this prop was being converted to `className` at the transform step, it caused some confusion when trying to access it in composite components. As a result we decided to make our DOM properties mirror their counterparts in the JS DOM API. There are [a few exceptions](https://github.com/facebook/react/blob/master/src/dom/DefaultDOMPropertyConfig.js#L156) where we deviate slightly in an attempt to be consistent internally.
The biggest change you'll notice as a developer is that we no longer support `class` in JSX as a way to provide CSS classes. Since this prop was being converted to `className` at the transform step, it caused some confusion when trying to access it in composite components. As a result we decided to make our DOM properties mirror their counterparts in the JS DOM API. There are [a few exceptions](https://github.com/facebook/react/blob/main/src/dom/DefaultDOMPropertyConfig.js#L156) where we deviate slightly in an attempt to be consistent internally.

The other major change in v0.5 is that we've added an additional build - `react-with-addons` - which adds support for some extras that we've been working on including animations and two-way binding. [Read more about these addons in the docs](/docs/addons.html).

Expand Down
2 changes: 1 addition & 1 deletion content/blog/2013-11-06-community-roundup-10.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The best part is that no drastic changes have been required to support all those

## TodoMVC Benchmarks {#todomvc-benchmarks}

Webkit has a [TodoMVC Benchmark](https://github.com/WebKit/webkit/tree/master/PerformanceTests/DoYouEvenBench) that compares different frameworks. They recently included React and here are the results (average of 10 runs in Chrome 30):
Webkit has a [TodoMVC Benchmark](https://github.com/WebKit/webkit/tree/main/PerformanceTests/DoYouEvenBench) that compares different frameworks. They recently included React and here are the results (average of 10 runs in Chrome 30):

- **AngularJS:** 4043ms
- **AngularJSPerf:** 3227ms
Expand Down
2 changes: 1 addition & 1 deletion content/blog/2014-02-05-community-roundup-15.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Fredrik Dyrkell ([@lexicallyscoped](https://twitter.com/lexicallyscoped)) rewrot

In a separate post, Dyrkell breaks down [how to build a binary clock component](http://www.lexicallyscoped.com/2014/01/23/ClojureScript-react-om-binary-clock.html) in Om.

[[Demo](http://www.lexicallyscoped.com/demo/binclock/)] [[Code](https://github.com/fredyr/binclock/blob/master/src/binclock/core.cljs)]
[[Demo](http://www.lexicallyscoped.com/demo/binclock/)] [[Code](https://github.com/fredyr/binclock/blob/main/src/binclock/core.cljs)]

### Time Travel: Implementing undo in Om {#time-travel-implementing-undo-in-om}
David Nolen shows how to leverage immutable data structures to [add global undo](https://swannodette.github.io/2013/12/31/time-travel/) functionality to an app – using just 13 lines of ClojureScript.
Expand Down
2 changes: 1 addition & 1 deletion content/blog/2014-02-16-react-v0.9-rc1.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ React.DOM.div(null,

We believe this new behavior is more helpful and eliminates cases where unwanted whitespace was previously added.

In cases where you want to preserve the space adjacent to a newline, you can write a JS string like `{"Monkeys: "}` in your JSX source. We've included a script to do an automated codemod of your JSX source tree that preserves the old whitespace behavior by adding and removing spaces appropriately. You can [install jsx\_whitespace\_transformer from npm](https://github.com/facebook/react/blob/master/npm-jsx_whitespace_transformer/README.md) and run it over your source tree to modify files in place. The transformed JSX files will preserve your code's existing whitespace behavior.
In cases where you want to preserve the space adjacent to a newline, you can write a JS string like `{"Monkeys: "}` in your JSX source. We've included a script to do an automated codemod of your JSX source tree that preserves the old whitespace behavior by adding and removing spaces appropriately. You can [install jsx\_whitespace\_transformer from npm](https://github.com/facebook/react/blob/main/npm-jsx_whitespace_transformer/README.md) and run it over your source tree to modify files in place. The transformed JSX files will preserve your code's existing whitespace behavior.

## Changelog {#changelog}

Expand Down
2 changes: 1 addition & 1 deletion content/blog/2014-02-20-react-v0.9.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ React.DOM.div(null,

We believe this new behavior is more helpful and eliminates cases where unwanted whitespace was previously added.

In cases where you want to preserve the space adjacent to a newline, you can write `{'Monkeys: '}` or `Monkeys:{' '}` in your JSX source. We've included a script to do an automated codemod of your JSX source tree that preserves the old whitespace behavior by adding and removing spaces appropriately. You can [install jsx\_whitespace\_transformer from npm](https://github.com/facebook/react/blob/master/npm-jsx_whitespace_transformer/README.md) and run it over your source tree to modify files in place. The transformed JSX files will preserve your code's existing whitespace behavior.
In cases where you want to preserve the space adjacent to a newline, you can write `{'Monkeys: '}` or `Monkeys:{' '}` in your JSX source. We've included a script to do an automated codemod of your JSX source tree that preserves the old whitespace behavior by adding and removing spaces appropriately. You can [install jsx\_whitespace\_transformer from npm](https://github.com/facebook/react/blob/main/npm-jsx_whitespace_transformer/README.md) and run it over your source tree to modify files in place. The transformed JSX files will preserve your code's existing whitespace behavior.

## Changelog {#changelog}

Expand Down
2 changes: 1 addition & 1 deletion content/blog/2014-04-04-reactnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ReactJS.NET is packaged in NuGet. Simply run `Install-Package React.Mvc4` in the
package manager console or search NuGet for "React" to install it.
[See the documentation](http://reactjs.net/docs) for more information. The
GitHub project contains
[a sample website](https://github.com/reactjs/React.NET/tree/master/src/React.Sample.Mvc4)
[a sample website](https://github.com/reactjs/React.NET/tree/main/src/React.Sample.Mvc4)
demonstrating all of the features.

Let us know what you think, and feel free to send through any feedback and
Expand Down
2 changes: 1 addition & 1 deletion content/blog/2014-05-06-flux.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ In Flux, the Dispatcher is a singleton that directs the flow of data and ensures

When a user interacts with a React view, the view sends an action (usually represented as a JavaScript object with some fields) through the dispatcher, which notifies the various stores that hold the application's data and business logic. When the stores change state, they notify the views that something has updated. This works especially well with React's declarative model, which allows the stores to send updates without specifying how to transition views between states.

Flux is more of a pattern than a formal framework, so you can start using Flux immediately without a lot of new code. An [example of this architecture](https://github.com/facebook/flux/tree/master/examples/flux-todomvc) is available, along with more [detailed documentation](https://facebook.github.io/flux/docs/overview.html) and a [tutorial](https://facebook.github.io/flux/docs/todo-list.html). Look for more examples to come in the future.
Flux is more of a pattern than a formal framework, so you can start using Flux immediately without a lot of new code. An [example of this architecture](https://github.com/facebook/flux/tree/main/examples/flux-todomvc) is available, along with more [detailed documentation](https://facebook.github.io/flux/docs/overview.html) and a [tutorial](https://facebook.github.io/flux/docs/todo-list.html). Look for more examples to come in the future.
2 changes: 1 addition & 1 deletion content/blog/2014-06-27-community-roundup-19.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The core concepts React themselves is something very valuable that the community

<iframe width="650" height="315" src="//www.youtube-nocookie.com/embed/KZjFVdU8VLI" frameborder="0" allowfullscreen></iframe>

And don't forget [Pete Hunt](https://github.com/petehunt)'s Wolfenstein 3D rendering engine in React ([source code](https://github.com/petehunt/wolfenstein3D-react/blob/master/js/renderer.js#L183)). While it's nearly a year old, it's still a nice demo.
And don't forget [Pete Hunt](https://github.com/petehunt)'s Wolfenstein 3D rendering engine in React ([source code](https://github.com/petehunt/wolfenstein3D-react/blob/main/js/renderer.js#L183)). While it's nearly a year old, it's still a nice demo.

[![](../images/blog/wolfenstein_react.png)](http://www.petehunt.net/wolfenstein3D-react/wolf3d.html)

Expand Down
4 changes: 2 additions & 2 deletions content/blog/2014-07-30-flux-actions-and-the-dispatcher.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "Flux: Actions and the Dispatcher"
author: [fisherwebdev]
---

Flux is the application architecture Facebook uses to build JavaScript applications. It's based on a unidirectional data flow. We've built everything from small widgets to huge applications with Flux, and it's handled everything we've thrown at it. Because we've found it to be a great way to structure our code, we're excited to share it with the open source community. [Jing Chen presented Flux](http://youtu.be/nYkdrAPrdcw?t=10m20s) at the F8 conference, and since that time we've seen a lot of interest in it. We've also published an [overview of Flux](https://facebook.github.io/flux/docs/overview.html) and a [TodoMVC example](https://github.com/facebook/flux/tree/master/examples/flux-todomvc/), with an accompanying [tutorial](https://facebook.github.io/flux/docs/todo-list.html).
Flux is the application architecture Facebook uses to build JavaScript applications. It's based on a unidirectional data flow. We've built everything from small widgets to huge applications with Flux, and it's handled everything we've thrown at it. Because we've found it to be a great way to structure our code, we're excited to share it with the open source community. [Jing Chen presented Flux](http://youtu.be/nYkdrAPrdcw?t=10m20s) at the F8 conference, and since that time we've seen a lot of interest in it. We've also published an [overview of Flux](https://facebook.github.io/flux/docs/overview.html) and a [TodoMVC example](https://github.com/facebook/flux/tree/main/examples/flux-todomvc/), with an accompanying [tutorial](https://facebook.github.io/flux/docs/todo-list.html).

Flux is more of a pattern than a full-blown framework, and you can start using it without a lot of new code beyond React. Up until recently, however, we haven't released one crucial piece of our Flux software: the dispatcher. But along with the creation of the new [Flux code repository](https://github.com/facebook/flux) and [Flux website](https://facebook.github.io/flux/), we've now open sourced the same [dispatcher](https://facebook.github.io/flux/docs/dispatcher.html) we use in our production applications.

Expand Down Expand Up @@ -41,6 +41,6 @@ Problems arise, however, if we have circular dependencies. That is, if Store A n
Example Chat App
----------------

Along with the same dispatcher that Facebook uses in its production applications, we've also published a new example [chat app](https://github.com/facebook/flux/tree/master/examples/flux-chat), slightly more complicated than the simplistic TodoMVC, so that engineers can better understand how Flux solves problems like dependencies between stores and calls to a web API.
Along with the same dispatcher that Facebook uses in its production applications, we've also published a new example [chat app](https://github.com/facebook/flux/tree/main/examples/flux-chat), slightly more complicated than the simplistic TodoMVC, so that engineers can better understand how Flux solves problems like dependencies between stores and calls to a web API.

We're hopeful that the new Flux repository will grow with time to include additional tools, boilerplate code and further examples. And we hope that Flux will prove as useful to you as it has to us. Enjoy!
6 changes: 3 additions & 3 deletions content/blog/2014-09-24-testing-flux-applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ author: [fisherwebdev]
Testing with Jest
-----------------

For a unit test to operate on a truly isolated _unit_ of the application, we need to mock every module except the one we are testing. Jest makes the mocking of other parts of a Flux application trivial. To illustrate testing with Jest, we'll return to our [example TodoMVC application](https://github.com/facebook/flux/tree/master/examples/flux-todomvc).
For a unit test to operate on a truly isolated _unit_ of the application, we need to mock every module except the one we are testing. Jest makes the mocking of other parts of a Flux application trivial. To illustrate testing with Jest, we'll return to our [example TodoMVC application](https://github.com/facebook/flux/tree/main/examples/flux-todomvc).

The first steps toward working with Jest are as follows:

Expand Down Expand Up @@ -154,7 +154,7 @@ describe('TodoStore', function() {
});
```

You can take a look at all this code in the [TodoStore's tests on GitHub](https://github.com/facebook/flux/tree/master/examples/flux-todomvc/js/stores/__tests__/TodoStore-test.js) as well.
You can take a look at all this code in the [TodoStore's tests on GitHub](https://github.com/facebook/flux/tree/main/examples/flux-todomvc/js/stores/__tests__/TodoStore-test.js) as well.


Mocking Data Derived from Other Stores
Expand All @@ -178,7 +178,7 @@ MyOtherStore.getState.mockReturnValue({

Now we have a collection of objects that will come back from MyOtherStore whenever we call MyOtherStore.getState() in our tests. Any application state can be simulated with a combination of these custom return values and the previously shown technique of working with the store's registered callback.

A brief example of this technique is up on GitHub within the Flux Chat example's [UnreadThreadStore-test.js](https://github.com/facebook/flux/tree/master/examples/flux-chat/js/stores/__tests__/UnreadThreadStore-test.js).
A brief example of this technique is up on GitHub within the Flux Chat example's [UnreadThreadStore-test.js](https://github.com/facebook/flux/tree/main/examples/flux-chat/js/stores/__tests__/UnreadThreadStore-test.js).

For more information about the `mock` property of mocked methods or Jest's ability to provide custom mock values, see Jest's documentation on [mock functions](https://facebook.github.io/jest/docs/mock-functions.html).

Expand Down
Loading