profile
viewpoint
Tim Dorr timdorr @onspaceship Atlanta, GA http://www.timdorr.com Cofounder of @onspaceship and @SalesLoft. Self-made intern at @reactjs and @reduxjs.

ReactTraining/react-router 41894

Declarative routing for React

reduxjs/redux-devtools 11643

DevTools for Redux with hot reloading, action replay, and customizable UI

reactjs/react-router-redux 7948

Ruthlessly simple bindings to keep react-router and redux in sync

ReactTraining/history 6651

Manage session history with JavaScript

knowbody/react-router-docs 56

Rewrite of the React Router docs - work in progress

timdorr/colony 10

:honeybee: A very lightweight, minimalist MVC framework for PHP

timdorr/deskjockey 4

:headphones: A custom feedback and support widget for Zendesk.

timdorr/atljs-webpack 2

:mega: Code from my talk to the Atlanta JavaScript Meetup about Webpack.

issue closedReactTraining/react-router

Redirects when reloading using lazy loading

<!-- Thank you for contributing!

Have a usage question?

The issue tracker is meant for bug reports only. This isn't the best place for usage questions. Questions here don't have as much visibility as they do elsewhere. Before you ask a question, here are some resources to get help first:

  • Read the docs: https://reacttraining.com/react-router
  • Check out the list of frequently asked questions: https://github.com/ReactTraining/react-router/blob/master/FAQ.md
  • Explore examples: https://reacttraining.com/react-router/web/example/basic
  • Look for/ask questions on Stack Overflow: https://stackoverflow.com/questions/ask?tags=react-router
  • Ask in chat: https://discord.gg/0ZcbPKXt5bYaNQ46

Think you found a bug?

The best bug report is a failing test in the repository as a pull request. Otherwise, please use the "BUG REPORT" template below.

Have a feature request?

Remove the template from below and provide thoughtful commentary and code samples on what this feature means for your product. What will it allow you to do that you can't do today? How will it make current work-arounds straightforward? What potential bugs and edge cases does it help to avoid? etc. Please keep it product-centric. -->

<!-- BUG TEMPLATE -->

Version

5.2.0

Test Case

https://codesandbox.io/s/hungry-robinson-5w30d

Steps to reproduce

  1. go to codesandbox ^
  2. press link (goto about)
  3. reload the embeded browser
  4. notice how the page redirects you to home

Expected Behavior

Expected that the page does not redirect me back to the home page when reloading using lazy loading.

Actual Behavior

The page redirects me to the home page when reloading using lazy loading.

closed time in 8 hours

halvardssm

issue commentReactTraining/react-router

Redirects when reloading using lazy loading

Suspense needs to be outside of the Switch. Switch only works on the first level of children, so it's getting in the way.

halvardssm

comment created time in 8 hours

push eventreduxjs/redux

Ideveloper (이승규)

commit sha 7ebcdfa727d68df2c3a44ecc22b9204ea99b0bce

feat: arrange import section of combineReducers (#3914)

view details

push time in 10 hours

PR merged reduxjs/redux

feat: arrange import section of combineReducers

name: Arrange import section of combineReducers and remove useless repeated import about: arrange import section

PR Type

Does this PR add a new feature, or fix a bug?

  • refactoring

Why should this PR be included?

  • It makes codes more clean!

Checklist

  • [x] Have you added an explanation of what your changes do and why you'd like us to include them?
  • [ ] Is there an existing issue for this PR?
    • link issue here
  • [x] Have the files been linted and formatted?
  • [x] Have the docs been updated to match the changes in the PR?
  • [ ] Have the tests been updated to match the changes in the PR?
  • [x] Have you run the tests locally to confirm they pass?

New Features

What new capabilities does this PR add?

What docs changes are needed to explain this?

Bug Fixes

What is the current behavior, and the steps to reproduce the issue?

What is the expected behavior?

How does this PR fix the problem?

+7 -6

2 comments

1 changed file

Brew-Brew

pr closed time in 10 hours

pull request commentreduxjs/redux

feat: arrange import section of combineReducers

Sure, why not. Thanks!

Brew-Brew

comment created time in 10 hours

issue commentreduxjs/redux-thunk

Create new npm release

Just keep in mind the only thing that has changed in that time is the build system and the TypeScript types. The code of the actual middleware hasn't changed in 4 years, and that was only to add extraArgument.

tony-scio

comment created time in 17 hours

issue closedreduxjs/redux

Not updating after a dispaching

I've integrated Realm with Redux on my app. Each time I do an action I want to register in the database I call to an action with dispatch, save on Realm and return the new information to the reducer. It works correctly. I have already subscripted to the changes on the screen I want to the data has been update.

So, the problem is the next. I'm in a secondary view where I do a booking. In this view, the state updates correctly and the view changes too. But in the main view (where I've donde the subscription) the data doesn't update. The subscription callback is launched, I know it because I put a console.log and the redux store has the correct info, but when I set the new date state, the view doesn't re-render although the state has the correct data too. I don't know why happens this.

const [bookings, setBookings] = useState(store.getState().booking.bookings); const unsubscribe = store.subscribe(() => { console.log('update'); setBookings(store.getState().booking.bookings); });

I've done everything, with a UseEffect hook, without it.

closed time in 17 hours

davidarnaub7

issue commentreduxjs/redux

Not updating after a dispaching

The issue tracker here on GitHub is reserved for bug reports and feature requests. For usage questions (which is what I believe this is), please use Stack Overflow or Reactiflux where there are a lot more people ready to help you out. Thanks!

Please feel free to reply if you think this issue was closed prematurely.

davidarnaub7

comment created time in 17 hours

push eventReactTraining/react-router

Amit Mittal

commit sha a97dbdb7297474ff0114411e363db2c8fb417e55

Close Route Tag (#7665)

view details

push time in a day

pull request commentReactTraining/react-router

Close Route Tag

Thanks!

amittal-quot

comment created time in a day

PR merged reduxjs/react-redux

Upgrade react peer dependency to v17

Fixes #1646

This PR only meets peerDependency, a dependency upgrade and version bump might be needed in order to support v17 completely.

+1 -1

2 comments

1 changed file

wachunei

pr closed time in a day

issue closedreduxjs/react-redux

Update React version in peerDependencies to meet React 17

<!-- Thank you for contributing to open source!

Do you need some help?

The issue tracker is meant for feature requests and bug reports only. This isn't the best place for support or usage questions. Questions here don't have as much visibility as they do elsewhere. Before you ask a question, here are some resources to get help first:

  • Read the docs: https://react-redux.js.org/
  • Check out the troubleshooting guide: https://react-redux.js.org/troubleshooting
  • Look for/ask questions on Stack Overflow: https://stackoverflow.com/questions/tagged/redux
  • Ask in chat: https://www.reactiflux.com/

Have a feature request?

Remove the template from below and provide thoughtful commentary and code samples on what this feature means for your product. What will it allow you to do that you can't do today? How will it make current work-arounds straightforward? What potential bugs and edge cases does it help to avoid? etc. Please keep it product-centric.

-->

New Features

Update React version in peerDependencies to meet React 17

What is the new or updated feature that you are suggesting?

React 17 support.

Why should this feature be included?

To support the latest stable version of React.

What docs changes are needed to explain this?

I suppose docs won't change.

closed time in a day

Constantiner

push eventreduxjs/react-redux

Pedro Pablo Aste Kompen

commit sha 32c521631e6a0fe818daa62f6b2b2bfa600309b2

Upgrade react peer dependency to v17 (#1647)

view details

push time in a day

pull request commentreduxjs/react-redux

Upgrade react peer dependency to v17

Welcome to The Future™

wachunei

comment created time in a day

push eventtimdorr/tesla-api

Kiko Beats

commit sha 957f2842cfb79800fbb3e142f6454882cde990fb

Add Model 3 white interior (#234)

view details

push time in 3 days

PR merged timdorr/tesla-api

Add Model 3 white interior
+2 -1

1 comment

1 changed file

Kikobeats

pr closed time in 3 days

pull request commenttimdorr/tesla-api

Add Model 3 white interior

Thanks!

Kikobeats

comment created time in 3 days

push eventReactTraining/react-router

Amnon Sadeh

commit sha 9016c5191cb1b8ce727dc5aaed97376b1b291a70

docs: fix typo (its -> it's) (#7663)

view details

push time in 4 days

pull request commentReactTraining/react-router

docs: fix typo (its -> it's)

targumon

comment created time in 4 days

issue commentreduxjs/react-redux

Context with store has been broken since 6.0.0

You can't use both context APIs at the same time. Provider in 6+ and 5.x are two very different components, so they don't overlap or allow legacy usage along with modern usage.

Regardless, we never documented accessing the store this way. You are using undocumented functionality, so there is no contract that we have to maintain. We have maintained connect compatibility, which is the primary way you should be interacting with Redux. We also now have official documentation on how to directly access the store, even though you really shouldn't: https://react-redux.js.org/using-react-redux/accessing-store

andrew-aladev

comment created time in 4 days

issue commentreduxjs/react-redux

Context with store has been broken since 6.0.0

This is only an internal change. No applications using our APIs broke. You shouldn't be using the Redux context yourself.

andrew-aladev

comment created time in 4 days

issue closedreduxjs/react-redux

Context with store has been broken since 6.0.0

import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import PropTypes from 'prop-types';
import { createStore } from 'redux';
import { connect, Provider } from 'react-redux';

const store = createStore(
  (state) => state,
  { key: 'value' },
);

class App extends Component {
  static contextTypes = {
    store: PropTypes.object.isRequired,
  };

  constructor(props, context) {
    super(props, context)
    console.log(context)
  }

  render() {
    return null
  }
}

const CApp = connect()(App);

ReactDOM.render(
  <Provider store={store}>
    <CApp />
  </Provider>,
  document.getElementById('root')
);

I think this code is legal for any react and redux versions, but it is limited to react-redux v5.x only. react-redux >= v6.0.0 is not able to provide store, it is always undefined.

closed time in 4 days

andrew-aladev

issue commentreduxjs/react-redux

Context with store has been broken since 6.0.0

We switched from the legacy context API in that version to the new createContext API. The legacy context API is deprecated and will be removed in a future version of React. You can read about it in the release notes for that version.

andrew-aladev

comment created time in 4 days

issue commentReactTraining/react-router

Attempted import error: '__RouterContext' is not exported from 'react-router'.

You should not be using that context directly. Regardless, it's included, so something is wrong with your installation.

naresh-FD

comment created time in 5 days

push eventreduxjs/redux

Chris Zhang

commit sha b3165d0cbd0d8f48142284807d764160df26d6fa

Fix naming when thunk-ifying AddPostForm.js. (#3906)

view details

push time in 7 days

PR merged reduxjs/redux

Fix naming when thunk-ifying AddPostForm.js.

name: :memo: Documentation Fix about: Fixing a problem in an existing docs page

Checklist

  • [ ] Is there an existing issue for this PR?
    • link issue here
  • [ ] Have the files been linted and formatted?

What docs page needs to be fixed?

  • Section: Async Logic and Data Fetching
  • Page: Checking Thunk Results in Components

What is the problem?

Naming of function being replaced is inaccurate.

What changes does this PR make to fix the problem?

Correctly names function to be replaced with thunk.

+1 -1

2 comments

1 changed file

chrzhang

pr closed time in 7 days

push eventreduxjs/redux

Masashi Hirano

commit sha 2baca9c149a98de52d08b231bd2963c72eba4621

fix: link to the page of webpack's 'mode' configuration (#3907) `https://webpack.js.org/concepts/mode/` was replaced with `https://webpack.js.org/configuration/mode/` by https://github.com/webpack/webpack.js.org/pull/2905.

view details

push time in 7 days

pull request commentreduxjs/redux

Fix naming when thunk-ifying AddPostForm.js.

Thanks!

chrzhang

comment created time in 7 days

PR merged reduxjs/redux

fix: link to the page of webpack's 'mode' configuration

name: :bug: fix: link to the page of webpack's 'mode' configuration about: Fixing link to the page of webpack's 'mode' configuration

PR Type

Does this PR add a new feature, or fix a bug?

This fixes a small bug.

Why should this PR be included?

https://webpack.js.org/concepts/mode/ was replaced with https://webpack.js.org/configuration/mode/ by https://github.com/webpack/webpack.js.org/pull/2905.

Checklist

  • [x] Have you added an explanation of what your changes do and why you'd like us to include them?
  • [ ] Is there an existing issue for this PR?
    • link issue here
  • [ ] Have the files been linted and formatted?
  • [ ] Have the docs been updated to match the changes in the PR?
  • [ ] Have the tests been updated to match the changes in the PR?
  • [ ] Have you run the tests locally to confirm they pass?

Bug Fixes

What is the current behavior, and the steps to reproduce the issue?

The below is printed when NODE_ENV isn't 'production' to minify code. It includes the old URL: https://webpack.js.org/concepts/mode.

You are currently using minified code outside of NODE_ENV === "production". This means that you are running a slower development build of Redux. You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) to ensure you have the correct code for your production build.

What is the expected behavior?

It is expected to include the new URL: https://webpack.js.org/configuration/mode.

You are currently using minified code outside of NODE_ENV === "production". This means that you are running a slower development build of Redux. You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify or setting mode to production in webpack (https://webpack.js.org/configuration/mode/) to ensure you have the correct code for your production build.

How does this PR fix the problem?

Change the old URL to the new one.

+1 -1

2 comments

1 changed file

shisama

pr closed time in 7 days

pull request commentreduxjs/redux

fix: link to the page of webpack's 'mode' configuration

Thanks!

shisama

comment created time in 7 days

issue closedReactTraining/react-router

Upgrade path-to-regexp to latest

<!-- Thank you for contributing!

Have a usage question?

The issue tracker is meant for bug reports only. This isn't the best place for usage questions. Questions here don't have as much visibility as they do elsewhere. Before you ask a question, here are some resources to get help first:

  • Read the docs: https://reacttraining.com/react-router
  • Check out the list of frequently asked questions: https://github.com/ReactTraining/react-router/blob/master/FAQ.md
  • Explore examples: https://reacttraining.com/react-router/web/example/basic
  • Look for/ask questions on Stack Overflow: https://stackoverflow.com/questions/ask?tags=react-router
  • Ask in chat: https://discord.gg/0ZcbPKXt5bYaNQ46

Think you found a bug?

The best bug report is a failing test in the repository as a pull request. Otherwise, please use the "BUG REPORT" template below.

Have a feature request?

Remove the template from below and provide thoughtful commentary and code samples on what this feature means for your product. What will it allow you to do that you can't do today? How will it make current work-arounds straightforward? What potential bugs and edge cases does it help to avoid? etc. Please keep it product-centric. -->

<!-- BUG TEMPLATE -->

Version

react-router 5.1.2 npm version 6.14.8 node >12.19.0 path-to-regexp 6.1.0

Steps to reproduce

run create-react-app with the above in package.json and the app will fail to compile

Expected Behavior

it should compile

Actual Behavior

Using the above config results in the following error

image

We believe this is because the path-to-regexp package currently imported in react-router is 1.7.0 and the latest version that we are using in our app does not include the default export that react-router is looking for

closed time in 8 days

rahul-sharma-uipath

issue commentReactTraining/react-router

Upgrade path-to-regexp to latest

We can't upgrade path-to-regexp because they removed /foo* matching. You need to get a separate version of path-to-regexp for React Router to use. npm should handle that automatically, so I would look into why that sub-dependency was upgraded. It's not something we did ourselves, as we request the 1.x version specifically.

rahul-sharma-uipath

comment created time in 8 days

push eventtimdorr/spotifeed

Tim Dorr

commit sha e6c1174ea7d3671dd3da53a21ca1651aa227c6d7

Better mobile site

view details

push time in 9 days

issue closedReactTraining/react-router

Using <Switch /> makes location.state accessed from withRouter HOC to not be defined.

Version

In my environment: 4.3.1 In sandbox provided: 5.2.0

Test Case

https://codesandbox.io/s/react-router-forked-vd9kr?file=/index.js

Steps to reproduce

  1. press the Home link to go to /test page
  2. In the comment at the sandbox when using Switch inside a nested route access to location.state from withRouter is overwritten. When not (use Fragment at the sandbox) then it works as expected.

Expected Behavior

When using Switch and I access location.state props from withRouter HOC I can see the state I have passed to the specific route. Screenshot 2020-10-14 at 3 39 34 PM

Actual Behavior

When using Switch and I access location.state props from withRouter HOC the state not defined. Screenshot 2020-10-14 at 3 39 47 PM

closed time in 9 days

npetridis

issue commentReactTraining/react-router

Using <Switch /> makes location.state accessed from withRouter HOC to not be defined.

Switch sets the location prop on the child it selects to render. This isn't the correct way to set that state anyways. You should be setting it on the Link so it's saved in the history stack.

npetridis

comment created time in 9 days

push eventreduxjs/redux

EhsanKhaki

commit sha 1c71dddba7d2df8233ac941ae203d3a78616b68d

Main Readme file improvements (#3903)

view details

push time in 9 days

PR merged reduxjs/redux

Main Readme file improvements

name: :memo: Documentation Fix about: Fixing a problem in an existing docs page

Checklist

  • [ ] Is there an existing issue for this PR?
    • link issue here
  • [X] Have the files been linted and formatted?

What docs page needs to be fixed?

  • Section: Main readme
  • Page: README.md

What is the problem?

There were a few issues with grammar and used words.

What changes does this PR make to fix the problem?

Making the readme more readable.

+14 -14

2 comments

1 changed file

ehsankhfr

pr closed time in 9 days

pull request commentreduxjs/redux

Main Readme file improvements

Please and thank you!

ehsankhfr

comment created time in 9 days

issue closedReactTraining/react-router

Migration guide from v3 to v6?

We have an older website which got stuck on react-router v3 because of the drastic changes that came in v4. Main issue was that all the routing in this website was based around single routes files with nested routes, and a rewrite of that was just too much and impossible to get prioritized. Maybe others are in the same situation?

Either way, I see that in v6, this feature is coming back?

Another important reason for using the element prop in v6 is that <Route children> is reserved for nesting routes. This is one of people's favorite features from v3 and @reach/router, and we're bringing it back in v6.

For the v6 release, would it be possible for someone knowledgeable to write a migration guide for upgrading from v3 to v6? Not necessarily super detailed, but just some sort of guidance with coming from v3 in mind, particularly surrounding how to migrate v3 nested routes to v6 nested routes?

🙏 #hopeful-we-can-finally-upgrade-and-get-those-tasty-hooks-in-this-project-as-well

closed time in 9 days

Svish

issue commentReactTraining/react-router

Migration guide from v3 to v6?

If someone wants to write that guide and submit it as a PR, we can definitely include it. But it's not something we're going to write ourselves, given the large number of changes between the two and the age since we've worked on anything v3-related.

Svish

comment created time in 9 days

PR closed ReactTraining/react-router

Add a 'useQueryString' hook

This PR adds a useQueryString hook, to get the queryString by <Link />.

+142 -3

2 comments

6 changed files

chenwenqin

pr closed time in 10 days

pull request commentReactTraining/react-router

Add a 'useQueryString' hook

Thanks, but React Router 5 takes an agnostic stance on query parameters. We expect you to handle them however you want in your own code. There's even an example to this effect: https://reactrouter.com/web/example/query-parameters

v6 adds parsing into URLSearchParams, but with more extensive browser support checks and some extra array conveniences. I would wait for that release, rather than backporting into the previous version.

chenwenqin

comment created time in 10 days

issue closedReactTraining/react-router

react router appears to be incompatible with react 16.13

When you install react-router in a basic react quickstart project it gives the following error:

Failed to compile ./node_modules/react-router-dom/esm/react-router-dom.js Module not found: Can't resolve '/home/react/node_modules/babel-loader/lib/index.js' in '/home/react'

closed time in 12 days

jwlogemann

issue commentReactTraining/react-router

react router appears to be incompatible with react 16.13

It works just fine with any version of React. Something is wrong with your installation, not this library.

jwlogemann

comment created time in 12 days

issue closedtimdorr/tesla-api

400 bad request

image

I make sure username and password is true

closed time in 13 days

erevus-cn

issue commenttimdorr/tesla-api

400 bad request

This is just documentation for the API. There is no support for the API itself.

erevus-cn

comment created time in 13 days

issue closedReactTraining/react-router

[Bug: v5] Wrapped <Route/> breaks the next <Route/>

Version

5.2.0

Test Case

https://codesandbox.io/s/agitated-grass-mcm3y?file=/src/App.js

Steps to reproduce

  1. Go to this codesandbox
  2. Click "Page B" link

Expected Behavior

The link should bring us to path /b and render "BBBB" text on the screen

Actual Behavior

The empty page was rendered instead.

To make it work as expected, we need to uncomment line 27 and 28. The problem is these props are irrelevant to the WrappedRoute component (which doesn't accept any props), but somehow make a different result.

closed time in 13 days

pobch

issue commentReactTraining/react-router

[Bug: v5] Wrapped <Route/> breaks the next <Route/>

Switch reads the props of its children directly, so you can't do this.

pobch

comment created time in 13 days

issue closedReactTraining/react-router

[website]

Expected Behavior

Clicking a link in the docs will send the user to the corresponding location in the docs.

image

Actual Behavior

Clicking a link in the docs sends the user back to the homepage.

image

(route doesn't exist, so user is redirected to homepage)

Note: This only applies to links within the docs, not nav links.

closed time in 14 days

Flandre-X

issue commentReactTraining/react-router

[website]

Duplicate of #7484

Flandre-X

comment created time in 14 days

issue closedReactTraining/react-router

Empty string hash fragment `#` is stripped from `to` prop

<!-- Thank you for contributing!

Have a usage question?

The issue tracker is meant for bug reports only. This isn't the best place for usage questions. Questions here don't have as much visibility as they do elsewhere. Before you ask a question, here are some resources to get help first:

  • Read the docs: https://reacttraining.com/react-router
  • Check out the list of frequently asked questions: https://github.com/ReactTraining/react-router/blob/master/FAQ.md
  • Explore examples: https://reacttraining.com/react-router/web/example/basic
  • Look for/ask questions on Stack Overflow: https://stackoverflow.com/questions/ask?tags=react-router
  • Ask in chat: https://discord.gg/0ZcbPKXt5bYaNQ46

Think you found a bug?

The best bug report is a failing test in the repository as a pull request. Otherwise, please use the "BUG REPORT" template below.

Have a feature request?

Remove the template from below and provide thoughtful commentary and code samples on what this feature means for your product. What will it allow you to do that you can't do today? How will it make current work-arounds straightforward? What potential bugs and edge cases does it help to avoid? etc. Please keep it product-centric. -->

<!-- BUG TEMPLATE -->

Version

5.2.0

Test Case

https://codesandbox.io/s/react-router-forked-z49on

Steps to reproduce

Create this link <Link to="/about#">About</Link>

Expected Behavior

For the href rendered in the browser to be .../about#

Actual Behavior

The herf rendered in the browser is .../about with the # stripped.

Why

The empty string hash fragment # means scroll to top. https://html.spec.whatwg.org/multipage/browsing-the-web.html#target-element https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href

closed time in 14 days

rafgraph

issue commentReactTraining/react-router

Empty string hash fragment `#` is stripped from `to` prop

You should use an a, not Link, to do this.

rafgraph

comment created time in 14 days

issue commentReactTraining/react-router

[v6] Attach arbitrary data to route (not on navigation)

You can already do that with a Context: https://reactjs.org/docs/context.html

We're not going to implement this because it's already a built-in React feature.

benneq

comment created time in 14 days

issue commentReactTraining/react-router

[v6] Attach arbitrary data to route (not on navigation)

You wouldn't be able to do that. The data wouldn't be in currentRoute before that Route has been rendered.

benneq

comment created time in 14 days

issue closedReactTraining/react-router

[v6] Attach arbitrary data to route (not on navigation)

I'd like to attach some data per Route, for example a Page Title, which can then be picked up and used within a component.

Something like this:

// route definitions:
const MyRoutes = () => {
  return (
    <Routes>
      <Route path="/foo" element={<FooPage />} data={{ title: "Foo" }} />
      <Route path="/bar" element={<BarPage />} data={{ title: "Bar" }} />
    </Routes>
  );
};
// page header component
const PageHeader = () => {
  const { data } = useActiveRoute(); // non-existing hook which returns the "data" field

  return (
    <header>{data.title}</header>
  );
};

Even better would be a way traverse the whole "active routes path", i.e. currentRoute> currentRoute.parent > currentRoute.parent.parent > etc.. This way it would be super easy to create and display breadcrumbs.

closed time in 14 days

benneq

issue commentReactTraining/react-router

[v6] Attach arbitrary data to route (not on navigation)

You would just pass that in as props to your component inside of the element prop:

// route definitions:
const MyRoutes = () => {
  return (
    <Routes>
      <Route path="/foo" element={<FooPage title="Foo" />} />
      <Route path="/bar" element={<BarPage title="Bar" />} />
    </Routes>
  );
};
benneq

comment created time in 14 days

push eventtimdorr/tesla-api

Kiko Beats

commit sha bf194c76d76bbc948d3ee902e59fa63a93bbb571

fix: remove duplicate word (#231)

view details

push time in 15 days

PR merged timdorr/tesla-api

fix: remove duplicate word
+1 -1

1 comment

1 changed file

Kikobeats

pr closed time in 15 days

pull request commenttimdorr/tesla-api

fix: remove duplicate word

Thanks!

Kikobeats

comment created time in 15 days

push eventtimdorr/tesla-api

Kiko Beats

commit sha 8c9f12191b35917b7c03bef0cd14fbe6b7d914b4

fix: remove duplicate code (#230)

view details

push time in 15 days

PR merged timdorr/tesla-api

fix: remove duplicate code
+0 -1

1 comment

1 changed file

Kikobeats

pr closed time in 15 days

pull request commenttimdorr/tesla-api

fix: remove duplicate code

Thanks!

Kikobeats

comment created time in 15 days

issue commentReactTraining/react-router

Add missing commonjs build to dev

We use the UMD build for CJS imports (main.js is our package.json's main field). That is compatible with CJS importing. If that library is doing something incorrect with the module, that's not our fault.

AdrienLemaire

comment created time in 16 days

issue closedReactTraining/react-router

Add missing commonjs build to dev

Using react-router-dom@experimental with my react concurrent project, and the why-did-you-render dev tool to debug components' unexpected rerenders.

why-did-you-render is loaded only on dev mode, and I use require() / commonjs to define the hooks to follow:

import React from "react";

if (process.env.NODE_ENV === "development") {
  const whyDidYouRender = require("@welldone-software/why-did-you-render");
  whyDidYouRender(React, {
    trackAllPureComponents: true, // useState, useEffect ...
    trackExtraHooks: [
      [require("@apollo/client/react/hooks/hooks.cjs"), "useReactiveVar"],
      [require("react-i18next/dist/commonjs/useTranslation"), "useTranslation"],
      [require("react-router-dom"), "useLocation"], // <-- Uncaught TypeError: Cannot set property useLocation of #<Object> which has only a getter
  });

I see that in master, root files are commonjs, and es6 files are written in the es/ directory In dev or dev-experimental, we only have typescript code.

The npm package seems to only contain es6 and umd builds:

$ ls node_modules/react-router-dom
index.d.ts  index.js.map  main.js       react-router-dom.development.js      react-router-dom.production.min.js      README.md    server.js
index.js    LICENSE       package.json  react-router-dom.development.js.map  react-router-dom.production.min.js.map  server.d.ts  umd

Can we have a cjs/ or commonjs/ directory similarly to the existing umd/ one ?

closed time in 16 days

AdrienLemaire

issue commenttimdorr/tesla-api

MFA support

Ah, I see why. MFA is being implemented on their separate SSO server. The oAuth client ID for that server? "ownerapi" So, the Owner API is basically a client of the SSO OAuth.

I would expect that direct auth to the Owner API will go away eventually, once enough app users have upgraded to the latest app version. I don't know their internal deprecation policy, but for the streaming API transition, that took at least a year to move to WebSockets. I don't know if they'll be so laid back for something like auth, but I don't think we're going to be shut out in the next few days or anything.

The very interesting thing is this may finally open the door for official third-party apps. If we can specify our own callback URLs (and those aren't yet locked down), you could auth to a third party site without giving away your password. Fingers crossed!

rawmean

comment created time in 16 days

push eventtimdorr/tesla-api

Tim Dorr

commit sha 53bf306f36e7c29455562ad85f6d5fe360ba2dcc

Update the version too.

view details

push time in 16 days

push eventtimdorr/tesla-api

Tim Dorr

commit sha 23b6bd520bac56c0af259266597a51f9bec16f74

Latest endpoints file

view details

push time in 16 days

issue commenttimdorr/tesla-api

MFA support

Yup, they don't appear to respect the MFA requirement yet:

I, [2020-10-06T15:55:05.999917 #97301]  INFO -- request: POST https://owner-api.teslamotors.com/oauth/token
I, [2020-10-06T15:55:05.999982 #97301]  INFO -- request: User-Agent: "github.com/timdorr/tesla-api v:3.0.6"
I, [2020-10-06T15:55:06.618454 #97301]  INFO -- response: Status 200
rawmean

comment created time in 16 days

issue commenttimdorr/tesla-api

MFA support

Looks like they just flipped the switch. I turned it on, so I'm going to poke around for a bit and see what's up.

rawmean

comment created time in 16 days

issue closedReactTraining/react-router

After redirect with cleanup-hook component render a previous value

Version

5.2.0

Test Case

With state as context - https://codesandbox.io/s/suspicious-easley-svkt2?file=/src/App.js With state as mobx's observable - https://codesandbox.io/s/adoring-fog-dsvew?file=/src/App.js:353-381

Steps to reproduce

Preconditions:

  • component A as a page for react-router
  • component B as a page for react-router
  • state which is used in A and B

Expected Behavior

  1. Initial state { value: 0 }
  2. Initial URI - /a
  3. React-router renders the component A. It renders { value: 0 }.
  4. Redirect to /b
  5. Component A has a cleanup hook where the state was updated to { value: 1 }
  6. React-router renders the component B. It renders { value:1 }

Actual Behavior

In .5 component B renders an old state { value: 0 } (before cleanup in component A). After it reacts for changes for second rerender it has a new state { value:1 }.

I bet either I'm doing smth wrong or I don't understand how it's possible to clean/reset global stores/states. I'd appreciate any feedback.

closed time in 16 days

qetr1ck-op

issue commentReactTraining/react-router

After redirect with cleanup-hook component render a previous value

This doesn't have anything to do with React Router. You're using Context incorrectly. By changing a property on the context value, you're not triggering an update of that context value. This is much like using useRef instead of useState. You need some sort of mechanism to broadcast context updates through your tree.

qetr1ck-op

comment created time in 16 days

issue closedtimdorr/tesla-api

set_charge_limit as distance

Hello Tim I'm using in my logic set_charge_limit to the the % value it should charge max.

However it would be easier and possibly more accurate to adjust that in km/mile. Is there such option in the API? I hear in the App people can adjust a distance limit since some time.

Thanks! Reto

closed time in 17 days

rkaderli

issue commenttimdorr/tesla-api

set_charge_limit as distance

The app is just doing the math based on the current percentage and predicted range. It still sends the request to the API as a percentage.

rkaderli

comment created time in 17 days

issue commenttimdorr/tesla-api

A connection attempt failed

You can set something up in Digital Ocean or OVH for cheap.

rkaderli

comment created time in 17 days

pull request commentreduxjs/react-redux

Update docusaurus

Hmm, do we want to upgrade to 2.0? Everything appears A-OK, but we would be using the legacy theme.

josephMG

comment created time in 17 days

issue commenttimdorr/tesla-api

A connection attempt failed

Ah, they are blocking as of a month ago. My bad. If you go through a proxy, you shouldn't have an issue.

rkaderli

comment created time in 17 days

issue closedtimdorr/tesla-api

List of charging states

I got 4 charging states detected:

  • Disconnected
  • NoPower
  • Charging
  • Complete

but sometimes in a weird state our app comes to an error parsing a charging state.

Are these all, or did I miss one?

closed time in 17 days

Ahmadre

issue closedtimdorr/tesla-api

400 ProtocolError with Streaming API

We've started having issues with the Streaming API and it appears that there is an issue with the async-websocket gem.

The stream method currently will hang under the latest released version of async-websocket (0.14.0). I submitted a patch to fix the hang (https://github.com/socketry/async-websocket/pull/24), but instead raises a ProtocolError with a status code of 400. Figuring out why it's throwing a 400 error is beyond my current understanding of the websocket protocol - it appears the issue is happening during handshake, when upgrading the connection to a websocket connection.

I then tested the streaming functionality with the carson python library to verify that there hasn't been any significant changes to the streaming API. It works fine there.

Finally, to get around this issue I reimplemented the streaming API using another ruby websocket library gem.

closed time in 17 days

cyu

push eventtimdorr/tesla-api

Kiko Beats

commit sha 009af036fc6c54303f72898e4eb5f12f34a3d2bb

Update Autopilot & Hardware codes (#228) * Update optioncodes.md * Update optioncodes.md * Update optioncodes.md * Update optioncodes.md * Update optioncodes.md

view details

push time in 17 days

PR merged timdorr/tesla-api

Update Autopilot & Hardware codes

I removed hardware keyword because hardware is a totally different thing; You can have Autopilot 2 with HW2, HW2.5 or HW3.0

+6 -10

4 comments

1 changed file

Kikobeats

pr closed time in 17 days

pull request commenttimdorr/tesla-api

Update Autopilot & Hardware codes

Thanks!

Kikobeats

comment created time in 17 days

issue commenttimdorr/tesla-api

A connection attempt failed

Heroku uses EC2 instances for the most part. They all run in the same IP space.

rkaderli

comment created time in 17 days

issue commenttimdorr/tesla-api

A connection attempt failed

Heroku, but they use AWS as their underlying service provider.

rkaderli

comment created time in 17 days

pull request commenttimdorr/tesla-api

Update optioncodes.md

Oops, looks like there are conflicts with your other PR.

Kikobeats

comment created time in 17 days

pull request commenttimdorr/tesla-api

Update optioncodes.md

Thanks!

Kikobeats

comment created time in 17 days

push eventtimdorr/tesla-api

Kiko Beats

commit sha 7a7e5a57a8026d6d4b682bcc4be326268605422e

Add Autopilot code for Model 3 (#227)

view details

push time in 17 days

PR merged timdorr/tesla-api

Add Autopilot code for Model 3

Screen Shot 2020-10-05 at 22 48 16

+1 -0

1 comment

1 changed file

Kikobeats

pr closed time in 17 days

PullRequestEvent

PR closed timdorr/tesla-api

Add Autopilot code for Model 3

Screen Shot 2020-10-05 at 22 48 16

+1 -0

1 comment

1 changed file

Kikobeats

pr closed time in 17 days

pull request commenttimdorr/tesla-api

Add Autopilot code for Model 3

Thanks!

Kikobeats

comment created time in 17 days

issue closedReactTraining/react-router

faille to run test script

I'm not sure if here is a good place to ask or not. (already tried on SO) I'd love to contribute on the awesome package but failed to run the test:

what I have doe :

yarn test

what happened

Error: Can't find a root directory while resolving a config file path.
Provided path to resolve: packages/*

what expected

run test script

os: win 10

closed time in 17 days

Morteza-Jenabzadeh

issue commentReactTraining/react-router

faille to run test script

Not sure if it works on Windows 10. I would try running within WSL or via GitHub Codespaces.

Morteza-Jenabzadeh

comment created time in 17 days

issue commenttimdorr/tesla-api

A connection attempt failed

That sounds like something is wrong with your code. I regularly communicate with Tesla's API from AWS datacenters.

rkaderli

comment created time in 17 days

push eventtimdorr/tesla-api

Kiko Beats

commit sha 10c56aeaca0d3b3fdb3d29c03e601c93f1d56919

Add cyclone code (#226)

view details

push time in 19 days

PR merged timdorr/tesla-api

Add cyclone code

Hello,

I found a missing code for cyclone wheels

749d51b7

Related: https://teslascout.com/view.php?vin=5YJSA7E26GF121393#container

+1 -0

1 comment

1 changed file

Kikobeats

pr closed time in 19 days

pull request commenttimdorr/tesla-api

Add cyclone code

Thanks!

Kikobeats

comment created time in 19 days

issue closedtimdorr/tesla-api

Support for option codes

Hi guys,

Uhm, sorry for raising an issue -- I'm more or less seeking information on what the deal is with OptionCodes, been doing lots of testing and our Tesla X test account returns lots of wrong features, I then realised that these are all based off of the Model 3, and saw you had mentioned this on your options code page!

Couple of queries on this, if I may please:

  1. The mobile apps can't be displaying vehicle features based on the returned codes right? or else the apps would be wrong!
  2. Could they be making further requests to a dedicated option code translation endpoint? seems plausible for this to exist.
  3. What processes were taken to determine the endpoint calls that are currently documented -- were app requests been traced/logged in some way, like wireshark or something? presumably the endpoints we have documented aren't the full picture here?

Thanks a lot!

Phil

closed time in 19 days

fyllepo
more