-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript typings for apm-rum-react #624
Comments
I am using apm-rum-react with typescript too and would like to have the typings in this package. |
The typings is already up published for We will try to add |
Here's the typing file I created in my project for this: // elastic__apm-rum-react.d.ts
declare module '@elastic/apm-rum-react' {
import { ComponentType } from 'react';
import { Route } from 'react-router';
export const ApmRoute: typeof Route;
/**
* Wrap a component to record an elastic APM transaction while it is rendered.
*
* Usage:
* - Pure function: `withTransaction('name','route-change')(Component)`
* - As a decorator: `@withTransaction('name','route-change')`
*/
export const withTransaction: (
name: string,
eventType: string,
) => <T>(component: ComponentType<T>) => ComponentType<T>;
} |
Also using React, would be nice to have typings... |
Hi! I opened a pull request with only adding declarations. What do you think about full rewriting on typescript? If maintainers approved this idea I can do it with apm-rum-react |
The Elastic doc uses import { Route, Routes } from 'react-router';
export const ApmRoute: typeof Route;
export const ApmRoutes: typeof Routes; |
Hi!
We are trying to use the apm-rum-react package. However we are using typescript and there don't seem to be any typings for apm-rum-react.
The text was updated successfully, but these errors were encountered: