A free book that talks about design patterns/techniques used while developing with React.

Comments
  • npm scripts fail with path/command on windows

    npm scripts fail with path/command on windows

    On windows it seems impossible to run the npm scripts. It looks like this has to do with the paths in the scripts in package.json.

    Error:

    '..' is not recognized as an internal or external command, operable program or batch file.

    npm ERR! Windows_NT 10.0.10586 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "build" npm ERR! node v4.4.7 npm ERR! npm v2.15.8 npm ERR! code ELIFECYCLE npm ERR! [email protected] build: ../../node_modules/.bin/browserify ./src/app.jsx -o ./public/app.js -t babelify npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] build script '../../node_modules/.bin/browserify ./src/app.jsx -o ./public/app.js -t babelify'. npm ERR! This is most likely a problem with the react-app package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! ../../node_modules/.bin/browserify ./src/app.jsx -o ./public/app.js -t babelify npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs react-app npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm ERR! npm owner ls react-app npm ERR! There is likely additional logging output above.

    I found a very old issue with the same problem: https://github.com/npm/npm/issues/2576

    The solution, removing the path, is not working of course. This has to do with the folder structure used in this repo.

    npm-debug.log

    _0 info it worked if it ends with ok 1 verbose cli [ 'C:\Program Files\nodejs\node.exe', 1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js', 1 verbose cli 'run', 1 verbose cli 'build' ] 2 info using [email protected] 3 info using [email protected] 4 verbose run-script [ 'prebuild', 'build', 'postbuild' ] 5 info prebuild [email protected] 6 info build [email protected] 7 verbose unsafe-perm in lifecycle true 8 info [email protected] Failed to exec build script 9 verbose stack Error: [email protected] build: browserify ./src/app.jsx -o ./public/app.js -t babelify 9 verbose stack Exit status 1 9 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:217:16) 9 verbose stack at emitTwo (events.js:87:13) 9 verbose stack at EventEmitter.emit (events.js:172:7) 9 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14) 9 verbose stack at emitTwo (events.js:87:13) 9 verbose stack at ChildProcess.emit (events.js:172:7) 9 verbose stack at maybeClose (internal/child_process.js:827:16) 9 verbose stack at Process.ChildProcess.handle.onexit (internal/child_process.js:211:5) 10 verbose pkgid [email protected] 11 verbose cwd D:\Workspaces\Git\react-in-patterns\patterns\composition 12 error Windows_NT 10.0.10586 13 error argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "build" 14 error node v4.4.7 15 error npm v2.15.8 16 error code ELIFECYCLE 17 error [email protected] build: browserify ./src/app.jsx -o ./public/app.js -t babelify 17 error Exit status 1 18 error Failed at the [email protected] build script 'browserify ./src/app.jsx -o ./public/app.js -t babelify'. 18 error This is most likely a problem with the react-app package, 18 error not with npm itself. 18 error Tell the author that this fails on your system: 18 error browserify ./src/app.jsx -o ./public/app.js -t babelify 18 error You can get information on how to open an issue for this project with: 18 error npm bugs react-app 18 error Or if that isn't available, you can get their info via: 18 error 18 error npm owner ls react-app 18 error There is likely additional logging output above. 19 verbose exit [ 1, true ]

    opened by Tarabass 7
  • DI examples powered by InversifyJS?

    DI examples powered by InversifyJS?

    Hi,

    I fund this repo on twitter because some users mentioned InversifyJS I keep an eye on mentions to InversifyJS because I'm it main author.

    Would you be interested in adding examples to the dependency-injection page about DI in react powered by InversifyJS?

    You can find some real use cases here and here.

    If you think you would like it I can prepare a PR.

    Thanks!

    opened by remojansen 7
  • One-way direction data flow question

    One-way direction data flow question

    In 'One-way direction data flow', Store provides subscription for change. Does Store also need to implement unsubscription for component App to call it inside componentWillUnmount to unsubscribe?

    opened by thanhvg 4
  • Can i help translate this repo to Vietnamese for support our community

    Can i help translate this repo to Vietnamese for support our community

    Hi mates

    I really excited and wanna translate this repo to Vietnamese for help our React developer community in Vietnam Can i create new pull request or fork new repo ๐Ÿ’ƒ

    opened by hprobotic 4
  • High-order component example does not return the enhanced component

    High-order component example does not return the enhanced component

    In the High-order example, it seems we forget to return the enhanced component.

    var enhanceComponent = (Component) => {
      class Enhance extends React.Component {
        render () {
          return (
            <Component {...this.props} />
          )
        }
      }
      
      // should we return the component here?
      return Enhance;
    }
    
    opened by dennisXZX 3
  • Broken link

    Broken link

    opened by SangKa 3
  • Fix some Grammar/Typo issues

    Fix some Grammar/Typo issues

    I recently read your book and I really like it! I spotted some grammar issues and typos here and there. These commits fix the ones I found. Also some parts sounded a bit weird, I corrected these aswell.

    I'm sure though that there are more typos/grammar issues that I overlooked so I definitely suggest that you run this through a tool like Word that helps you in finding the issues and fixing them. It would make the reading experience a lot more pleasant.

    opened by panmona 3
  • Children is  a JSX expression

    Children is a JSX expression

    When I use a JSX expression as children, I got the warning..

    ...
    const record = {
          title: 'foo',
          status: 'bar',
    };
    return (
      <Record>{record}</Record>
    );
    

    warning is like this:

    Warning: Failed prop type: Invalid prop `children` of type `object` supplied to `Record`, expected a single ReactElement.
    

    React version is 16.2.0 can you help me??

    opened by horizon0514 3
  • Children in JSX

    Children in JSX

    Refering to : https://github.com/krasimir/react-in-patterns/tree/master/patterns/children-in-jsx

    I think:

            <i className='something-else'>
              { props.children }
            </i>
    

    Should be :

            <i className='something-else' children={children}/>
    

    Note that they are not equivalent. First one creates new children with a single item, the second one reuses the children. I've heard issues with the first pattern e.g. keys/ids confused React. Don't have an issue report as the second syntax fixed it :rose:

    opened by basarat 3
  • Communication pattern changes

    Communication pattern changes

    Hi Saw your repo on Hacker News; Wanted to help a bit

    • Changed the onClick on the communication patter files to not bind on every click but use it on constructor (it is considered a good practice)
    • Changed the order of the methods, render should be the last method called in a react component, handlers and other things should be up.
    • Remove extra spaces on curly braces and so (this will help if you consider adding ESLint to the flow later)
    opened by davixyz 3
  • In Chapter 8, the mixins link does not contain the content

    In Chapter 8, the mixins link does not contain the content

    opened by pakaponk 2
  • GitBook links no longer work

    GitBook links no longer work

    Great book, thank you for writing it!

    I've noticed that the GitBook links no longer work - none of the downloadable options work and neither is the link in the "About" section. Can still read everything on here, obviously, but perhaps these can be fixed as I understand GitBook has gone through some major changes recently but is still free for personal projects. Alternatively, there is a free GitBook-inspired option you could move the book to: https://github.com/filipowm/BooGi .

    opened by nina-py 0
  • Small typo in second section of Chapter 10 (plus Summary and repo Readme)

    Small typo in second section of Chapter 10 (plus Summary and repo Readme)

    The second section of Chapter 10 reads:

    Using React's context (prior v. 16.3)

    Since prior is an adjective (or noun), one of these would probably read better for the part in parentheses:

    1. prior to v. 16.3
    2. below v. 16.3 (this would align with "v. 16.3 and above" in the next section)
    3. before v. 16.3

    Whichever change is chosen, the same change would be needed in Chapter 10 itself (book/chapter-10/README.md), the Summary (book/SUMMARY.md), and the Content section of the repo readme (README.md).

    opened by jdsandifer 0
  • Flux Utils

    Flux Utils

    I didn't see a mention of Flux Util's(https://facebook.github.io/flux/docs/flux-utils.html) which seems like one of the least boilerplate implementations of Flux, and provided by facebook.

    You allude to this kind of solution in "Using a helper", but dismiss it because "may decide to switch to another Flux provider". That rationale is quite bizarre, I think 99.99% of applications will not be, and should not be, switching Flux providers.

    Would like to hear your opinion on using Flux-Util's ReduceStore with Containers

    opened by patelnav 1
  • Using HTML Entities/Special Characters

    Using HTML Entities/Special Characters

    Use String.fromCharCode() for special characters.

    // bad
    <div>John ยท Doe</div>
    
    // nope
    <div>John &middot; Doe</div>
    
    // good
    <div>{'John ' + String.fromCharCode(183) + ' Doe'}</div>
    
    // better
    <div>{`John ${String.fromCharCode(183)} Doe`}</div>
    
    // Unicode
    <i data-icon={String.fromCharCode(0xf00f)} />
    
    // or if you have it as a string for some reason
    <i data-icon={String.fromCharCode(parseInt('f00f', 16))} />
    
    opened by pivanov 2
  • Dependency Injection using .defaultProps

    Dependency Injection using .defaultProps

    I've created a gist that shows how DI could be solved for cases using only React features: https://gist.github.com/topa/efd6b170e18bda579aa751c5164f9211.

    Do you think this could be also a valid approach?

    This won't work with isomorphic apps as you'll have to initialize .getAppLocale() while bootstrapping the app either on server (e.g. in express Apps req.locale ) as on client (using window.navigator).

    opened by topa 1
Owner
Krasimir Tsonev
I'm a blogger, who writes and speaks. I love open source and I code awesome stuff.
Krasimir Tsonev
Recoil is an experimental state management library for React apps. It provides several capabilities that are difficult to achieve with React alone, while being compatible with the newest features of React.

Recoil ยท Recoil is an experimental set of utilities for state management with React. Please see the website: https://recoiljs.org Installation The Rec

Facebook Experimental 18.2k Jan 8, 2023
The Bookstore is a website similar to the "Awesome Books" website built in the previous module. You will create an MVP version of it that allows you to: Display a list of books. Add a book. Remove a selected book.

Bookstore The Bookstore is a website similar to the "Awesome Books" website built in the previous module. You will create an MVP version of it that al

Anuar Shaidenov 6 Jun 12, 2022
The Bookstore is a website similar to the "Awesome Books" website. Here we will create an MVP version of it that allows you to: Display a list of books, Add a book and Remove a selected book.

Book Store This is Book Store project. Built With HTML CSS JavaScript React Screenshot Live Demo Go Live ?? Getting Started Open dev branch Open VSCod

Tadesse Alemayehu 5 May 3, 2022
Material-UI is a simple and customizable component library to build faster, beautiful, and more accessible React applications. Follow your own design system, or start with Material Design.

Material-UI Quickly build beautiful React apps. Material-UI is a simple and customizable component library to build faster, beautiful, and more access

Material-UI 83.6k Dec 30, 2022
Challenge [Frontend Mentor] - In this challenge, JavaScript was used to filter jobs based on the selected categories. Technologies used: HTML5, CSS3 and React.

Frontend Mentor - Job listings with filtering Front-end challenge focused on javascript logic, where a list of fictitious vacancies is presented and t

Rui Neto 11 Apr 13, 2022
Glob - Github action to match glob patterns and retrieve the relative file paths.

Glob - Github action to match glob patterns and retrieve the relative file paths.

tj-actions 8 Dec 12, 2022
Utilities library built on top of Next.js providing feature extensions and helpers for common patterns

nextjs-utilites This library provides many helpful utilities for use in Next.js projects. Prerequisites This project requires NodeJS (version 8 or lat

Snehil K 5 Sep 7, 2022
Sandbox for developing and testing UI components in isolation

React Cosmos Sandbox for developing and testing UI components in isolation. Visual TDD. Develop one component at a time. Isolate the UI you're working

React Cosmos 7.7k Jan 3, 2023
Mini Social Media App with a liitle bit of facebook components (Still Developing)

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

KingNelxV2 2 Apr 11, 2022
Start developing LIFF application with a simple CLI command.

@line/create-liff-app Start developing LIFF application with a simple CLI command. About LIFF Templates Getting Started Create LIFF Channel Installati

LINE 27 Nov 10, 2022
A personal project, made with React, React Native, Typescript and some of the most used front-end libraries.

A personal project, made with React, React Native, Typescript and some of the most used front-end libraries.

Alvaro Junior 1 Jul 23, 2022
Soft UI Dashboard React - Free Dashboard using React and Material UI

Soft UI Dashboard React Start your Development with an Innovative Admin Template for Material-UI and React. If you like the look & feel of the hottest

Creative Tim 182 Dec 28, 2022
Free Open Source High Quality Dashboard based on Bootstrap 4 & React 16: http://dashboards.webkom.co/react/airframe

Airframe React High Quality Dashboard / Admin / Analytics template that works great on any smartphone, tablet or desktop. Available as Open Source as

Mustafa Nabavi 6 Jun 5, 2022
This is a Chrome extension that aims to encourage accessibility awareness while using GitHub

github-a11y This is a Google Chrome extension that runs a simple JavaScript snippet on github.com domain and aims to encourage accessibility mindfulne

Kate Higa 9 Jul 24, 2022
Developer Dao FM is where you can chill and listen to Lofi music while building cool stuff!

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

Developer DAO 9 Jul 21, 2022
An experimental hover effect, where a content preview is shown while a mini map indicates the position of the cursor.

Hover Preview Effect with Mini Map An experimental hover effect, where a content preview is shown while a mini map indicates the position of the curso

Codrops 27 Dec 29, 2022
A frontend Framework for building B2B applications running in the browser on top of REST/GraphQL APIs, using ES6, React and Material Design

react-admin A frontend Framework for building data-driven applications running in the browser on top of REST/GraphQL APIs, using ES6, React and Materi

marmelab 21.2k Dec 30, 2022
A set of React components implementing Google's Material Design specification with the power of CSS Modules

React Toolbox is a set of React components that implement Google's Material Design specification. It's powered by CSS Modules and harmoniously integra

React Toolbox 8.7k Dec 30, 2022