Giter VIP home page Giter VIP logo

Comments (4)

grigio avatar grigio commented on July 26, 2024 6

as workaround this works:

export default class App extends React.Component<any,any> {

from mobx-react-router.

alisd23 avatar alisd23 commented on July 26, 2024 2

This seems like a TypeScript question more than anything. Might be worth asking on StackOverflow: https://stackoverflow.com/

Will close for now until we can confirm it is an issue with this library.

from mobx-react-router.

notVitaliy avatar notVitaliy commented on July 26, 2024 1

This is the proper way to do this.

import React, { Component } from 'react'
import { inject, observer } from 'mobx-react'
import { RouterStore } from 'mobx-react-router'

interface Props {
  routing?: RouterStore
}

@inject('routing')
@observer
export default class App extends React.Component<Props> {
}

from mobx-react-router.

grigio avatar grigio commented on July 26, 2024

@notVitaliy thanks but I get another error

...
export default withRouter(App)

referred to App

[ts]
Argument of type 'typeof App' is not assignable to parameter of type 'ComponentType<RouteComponentProps<any, StaticContext>>'.
  Type 'typeof App' is not assignable to type 'StatelessComponent<RouteComponentProps<any, StaticContext>>'.
    Type 'typeof App' provides no match for the signature '(props: RouteComponentProps<any, StaticContext> & { children?: ReactNode; }, context?: any): ReactElement<any> | null'.

from mobx-react-router.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.