score:1
Accepted answer
just move the common methods to a separate interface that is extended by all of your interfaces:
interface common {
getinitialprops: ({ assets, data, renderpage }: documentprops) => any;
load: () => promise<react.reactnode>;
}
export interface asyncroutecomponent<props> extends common, react.component<props, asyncroutecomponentstate> { }
export interface asyncroutecomponentclass<props> extends common, asyncroutecomponent<props> {
new (props: props): asyncroutecomponent<props>;
}
export interface asyncroutestateless<props> extends common, asyncroutecomponent<props> {
(props: props): asyncroutecomponent<props>;
}
Source: stackoverflow.com
Related Query
- remove duplication from react typescript interfaces
- React - Typescript interfaces - errors when get props from union types
- how to remove number from array of numbers using TypeScript and React
- React typescript remove `undefined` from props listed in default props
- How can I remove an attribute from a React component's state object
- React with Typescript - Type { } is missing the following properties from type
- How can I remove unused imports/declarations from the entire project of React Typescript?
- TypeScript conditional types: Extract component props type from react component
- React JS: how to properly remove an item from this.state.data where data is an array of objects
- React TypeScript component with two different prop interfaces
- Unload / Release / Remove React Native View from runtime
- React TypeScript get Data Attribute From Click Event
- Remove expo from react native
- Remove white spaces from both ends of a string inside a form - React
- Remove caret from semantic-ui react dropdown menu
- How to properly import React JSX from separate file in Typescript 1.6
- React hooks - remove from react-router location state when we refresh page
- Remove last route from react navigation stack
- React Typescript event type for both interfaces MouseEvent and TouchEvent
- How To Declare TypeScript Static Method From React Functional Component
- Remove .html extension from a url for a website built using React and Webpack
- How to remove storybook from the react project
- Remove query from cache without refetching react query
- Correct way to remove key from react state
- Remove margin from body in React
- Does React remove the node with display:none from DOM?
- How to remove caret from dropdown nav item in React Bootstrap
- Remove a prop from cloned React component
- Fixing typescript warnings when inferring react props types from map of string=>type
- Remove item from array in React
More Query from same tag
- Simple Conditional Routing in Reactjs
- splice in Immutability Helpers
- main.js 404 error for MIT react-starter-kit
- Assign types on setState to React Typescript
- How To Use VdoCipher with React js
- Need help configuring react-hot-loader
- Is there any instruction to migrate from redux-form to react-final-form?
- React Js state error (Cannot update during an existing state)
- Trying to check the item already printed and print items other than that
- React state defind as property deep clone returns 'is undefined'
- Best way to destructuring inside react components?
- change Url when component renders with react-router-dom?
- How to convert a file to binary stream in Javascript?
- Is it possible to use references as react component's prop or state?
- Can not properly create a main layout with nextjs
- How to label in html NOT with id?
- Howto add text on background image in reactjs
- Is it possible to access to NFC functionalities from a React App
- How to pass data to client using React redux and socket.io?
- Webpack - npm run start and build doesn't work?
- How to useEffect when value in localStorage changed?
- Redux how to access state
- Need to fetch data into array BEFORE sending it as a prop in React
- How to make Material-UI CardActions always stick to the bottom of parent
- Using typescript in state slices of Reduxjs/toolkit
- Render multiple Select components depending on another multi value Select component
- React Hooks with React Router v4 - how do I redirect to another route?
- React Apollo GraphQL : Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag?
- how do you prevent functions inside useEffect from being triggered more than once?
- how to work with json in react.js