fix: build issue with "React is not defined"
This commit is contained in:
parent
686b5643b3
commit
8cbe5c3bf2
@ -5,8 +5,6 @@ import { Form, HandleForm } from 'react-component-form'
|
|||||||
import './index.css'
|
import './index.css'
|
||||||
import GitHubLogo from 'url:./github.jpg'
|
import GitHubLogo from 'url:./github.jpg'
|
||||||
|
|
||||||
global.React = React
|
|
||||||
|
|
||||||
const App: React.FC = () => {
|
const App: React.FC = () => {
|
||||||
const handleSubmit: HandleForm = (formData, formElement) => {
|
const handleSubmit: HandleForm = (formData, formElement) => {
|
||||||
console.clear()
|
console.clear()
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"testEnvironment": "jsdom",
|
"testEnvironment": "jsdom",
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"setupFilesAfterEnv": ["<rootDir>/__test__/setup.ts"],
|
|
||||||
"transform": {
|
"transform": {
|
||||||
"^.+\\.tsx?$": "esbuild-jest"
|
"^.+\\.tsx?$": "esbuild-jest"
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import React from 'react'
|
||||||
import { render, cleanup, fireEvent } from '@testing-library/react'
|
import { render, cleanup, fireEvent } from '@testing-library/react'
|
||||||
|
|
||||||
import { Form, HandleForm } from '..'
|
import { Form, HandleForm } from '..'
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
import React from 'react'
|
|
||||||
|
|
||||||
global.React = React
|
|
@ -1,4 +1,4 @@
|
|||||||
import { useRef } from 'react'
|
import React, { useRef } from 'react'
|
||||||
|
|
||||||
export interface FormDataObject {
|
export interface FormDataObject {
|
||||||
[key: string]: FormDataEntryValue
|
[key: string]: FormDataEntryValue
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"noUnusedParameters": true,
|
"noUnusedParameters": true,
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"jsx": "react-jsx",
|
"jsx": "react",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
Reference in New Issue
Block a user