Browse Source

Fix case-sensitive search term in example. (#4024)

* Fix case-sensitive search term in example.

Converting both the name and search value to lowercase solves case sensitive searching.

* Update thinking-in-react.md

* Update thinking-in-react.md

* Update thinking-in-react.md

Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
main
eastcoasting 3 years ago
committed by GitHub
parent
commit
58196f0305
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      beta/src/pages/learn/thinking-in-react.md

12
beta/src/pages/learn/thinking-in-react.md

@ -346,7 +346,11 @@ function ProductTable({ products, filterText, inStockOnly }) {
let lastCategory = null;
products.forEach((product) => {
if (product.name.indexOf(filterText) === -1) {
if (
product.name.toLowerCase().indexOf(
filterText.toLowerCase()
) === -1
) {
return;
}
if (inStockOnly && !product.stocked) {
@ -533,7 +537,11 @@ function ProductTable({ products, filterText, inStockOnly }) {
let lastCategory = null;
products.forEach((product) => {
if (product.name.indexOf(filterText) === -1) {
if (
product.name.toLowerCase().indexOf(
filterText.toLowerCase()
) === -1
) {
return;
}
if (inStockOnly && !product.stocked) {

Loading…
Cancel
Save