React: Use new JSX transform (#88802)
* update eslint, tsconfig + esbuild to handle new jsx transform * remove thing that breaks the new jsx transform * remove react imports * adjust grafana-icons build * is this the correct syntax? * try this * well this was much easier than expected... * change grafana-plugin-configs webpack config * fixes * fix lockfile * fix 2 more violations * use path.resolve instead of require.resolve * remove react import * fix react imports * more fixes * remove React import * remove import React from docs * remove another react import
This commit is contained in:
@@ -13,7 +13,6 @@ To access the theme in your styles, use the `useStyles` hook. It provides basic
|
||||
> Please remember to put `getStyles` function at the end of the file!
|
||||
|
||||
```tsx
|
||||
import React from 'react';
|
||||
import { GrafanaTheme2 } from '@grafana/data';
|
||||
import { useStyles2 } from '@grafana/ui';
|
||||
import { css } from '@emotion/css';
|
||||
@@ -40,7 +39,6 @@ Let's say you need to style a component that has a different background dependin
|
||||
|
||||
```tsx
|
||||
import { css, cx } from '@emotion/css';
|
||||
import React from 'react';
|
||||
|
||||
import { GrafanaTheme2 } from '@grafana/data';
|
||||
import { useStyles2 } from '@grafana/ui';
|
||||
|
||||
@@ -176,7 +176,6 @@ Here's how the test would look like for this [OrgPicker](https://github.com/graf
|
||||
```tsx
|
||||
import { screen, render } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import React from 'react';
|
||||
|
||||
import { OrgPicker } from './OrgPicker';
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ Here's how to use Grafana themes in React components.
|
||||
`useStyles2` memoizes the function and provides access to the theme.
|
||||
|
||||
```tsx
|
||||
import React, { FC } from 'react';
|
||||
import { FC } from 'react';
|
||||
import { GrafanaTheme2 } from '@grafana/data';
|
||||
import { useStyles2 } from '@grafana/ui';
|
||||
import { css } from '@emotion/css';
|
||||
@@ -39,7 +39,7 @@ const getStyles = (theme: GrafanaTheme2) =>
|
||||
#### Get the theme object
|
||||
|
||||
```tsx
|
||||
import React, { FC } from 'react';
|
||||
import { FC } from 'react';
|
||||
import { useTheme2 } from '@grafana/ui';
|
||||
|
||||
const Foo: FC<FooProps> = () => {
|
||||
|
||||
Reference in New Issue
Block a user