How would one go about informing PropTypes of the appropriate type if a property that is an interface?
Requirements - Using both TS and PropTypes.
Goal - something more accurate than PropTypes.any that passes standard eslint and tslint.
Limitation - Cannot bring in additional packages to generate it or do it for me somehow
import React from "react";
import PropTypes from "prop-types";
interface Test {
a: string;
b: string;
}
interface TestProps {
test: Test;
other: string;
}
const tester: React.FC<TestProps> = (props) => <div>{JSON.stringify(props.test)}</div>;
tester.propTypes = {
other: PropTypes.string.isRequired,
test: PropTypes.any.isRequired
};
export default tester;