profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/ReactTraining/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
React Training ReactTraining Carlsbad, CA https://reacttraining.com High-quality open source software from React Training

ReactTraining/react-router 43374

Declarative routing for React

ReactTraining/history 7023

Manage session history with JavaScript

ReactTraining/react-media 2370

CSS media queries for React

ReactTraining/react-broadcast 1323

Reliably communicate state changes to deeply nested React elements

ReactTraining/classic-react-workshop 1299

Lectures and exercises for React Training workshops

ReactTraining/react-stdio 620

Render React.js components on any backend

ReactTraining/hooks-workshop 399

The course material for our React Hooks workshop

ReactTraining/react-history 265

Manage session history with React

ReactTraining/react-workshop 205

The course material for our React Hooks workshop

ReactTraining/react-point 204

Fast touch events for React

startedReactTraining/react-router

started time in an hour

startedReactTraining/react-media

started time in 2 hours

startedReactTraining/react-media

started time in 3 hours

startedReactTraining/react-router

started time in 4 hours

startedReactTraining/history

started time in 5 hours

startedReactTraining/react-router

started time in 6 hours

startedReactTraining/history

started time in 17 hours

issue openedReactTraining/react-router

6.0.0-beta.0: problems with value comparisons in code

I saw the comparison code in 6.0.0-beta.0

export function generatePath(path: string, params: Params = {}): string {
  return path
    .replace(/:(\w+)/g, (_, key) => {
      invariant(params[key] != null, `Missing ":${key}" param`);
      return params[key];
    })
    .replace(/\/*\*$/, _ =>
      params['*'] == null ? '' : params['*'].replace(/^\/*/, '/')
    );
}
export function useInRouterContext(): boolean {
  return React.useContext(LocationContext).location != null;
}

Why should ! = and == , I'm curious why write it this way

created time in 20 hours

startedReactTraining/history

started time in a day

startedReactTraining/react-router

started time in a day

startedReactTraining/react-router

started time in a day

startedReactTraining/react-router

started time in a day

startedReactTraining/classic-react-workshop

started time in a day

startedReactTraining/react-router

started time in a day

issue closedReactTraining/react-router

about useHistory from react-router-dom some problem

is me use error? why history is undefined,i want to user history.push()

https://codesandbox.io/embed/react-router-v5-starter-forked-zn0dm?fontsize=14&hidenavigation=1&theme=dark

closed time in a day

FlyFishCode

startedReactTraining/history

started time in 2 days

startedReactTraining/react-router

started time in 2 days

startedReactTraining/react-router

started time in 2 days

issue commentReactTraining/react-router

about useHistory from react-router-dom some problem

Thank you, it has been resolved. Can help me find documentation about useHistory api. I can't find it in'react-router-dom'

FlyFishCode

comment created time in 2 days

issue commentReactTraining/react-router

about useHistory from react-router-dom some problem

ok,i'll try

FlyFishCode

comment created time in 2 days

issue commentReactTraining/react-router

about useHistory from react-router-dom some problem

You have to wrap the Router component in the outer layer. Now that it's in the App component, you can try it by moving the UseHistory component to the About component

FlyFishCode

comment created time in 2 days

issue commentReactTraining/react-router

about useHistory from react-router-dom some problem

The Router component must be wrapped in an outer layer

FlyFishCode

comment created time in 2 days

startedReactTraining/react-router

started time in 2 days

startedReactTraining/react-router

started time in 2 days