fix: build issue with "React is not defined"

This commit is contained in:
Divlo 2022-04-07 11:37:42 +02:00
parent 686b5643b3
commit 8cbe5c3bf2
No known key found for this signature in database
GPG Key ID: 8F9478F220CE65E9
6 changed files with 3 additions and 8 deletions

View File

@ -5,8 +5,6 @@ import { Form, HandleForm } from 'react-component-form'
import './index.css'
import GitHubLogo from 'url:./github.jpg'
global.React = React
const App: React.FC = () => {
const handleSubmit: HandleForm = (formData, formElement) => {
console.clear()

View File

@ -1,7 +1,6 @@
{
"testEnvironment": "jsdom",
"rootDir": "./src",
"setupFilesAfterEnv": ["<rootDir>/__test__/setup.ts"],
"transform": {
"^.+\\.tsx?$": "esbuild-jest"
}

View File

@ -1,3 +1,4 @@
import React from 'react'
import { render, cleanup, fireEvent } from '@testing-library/react'
import { Form, HandleForm } from '..'

View File

@ -1,3 +0,0 @@
import React from 'react'
global.React = React

View File

@ -1,4 +1,4 @@
import { useRef } from 'react'
import React, { useRef } from 'react'
export interface FormDataObject {
[key: string]: FormDataEntryValue

View File

@ -13,7 +13,7 @@
"noUnusedLocals": true,
"noUnusedParameters": true,
"moduleResolution": "node",
"jsx": "react-jsx",
"jsx": "react",
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,