Skip to content

Instantly share code, notes, and snippets.

@mikebridge
Created March 22, 2017 15:43
Typescript component using react-intl
import * as React from "react";
import SelectField from "material-ui/SelectField";
import { intlShape, injectIntl, FormattedMessage, InjectedIntlProps } from "react-intl";
interface IExampleProps {
// ...
}
class ExampleComponentWrapped extends React.Component<IExampleProps & InjectedIntlProps, {}> {
static propTypes: React.ValidationMap<any> = {
intl: intlShape.isRequired
};
public render(): JSX.Element {
return (
<SelectField floatingLabelText={this.props.intl.formatMessage({id: "hello_world"})} />
);
}
}
const ExampleComponent = injectIntl(ExampleComponentWrapped);
export default ExampleComponent;
@smaslovv
Copy link

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment