Last active
September 3, 2020 17:06
-
-
Save HipsterBrown/6480f7cc89afd083fb4aa827d6a89699 to your computer and use it in GitHub Desktop.
Minimal recreation of issue in `@react-aria/button` v3.2.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>React-Aria Example</title> | |
<script src="./index.tsx"></script> | |
</head> | |
<body> | |
<div id="app"></div> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useRef } from "react"; | |
import { render } from "react-dom"; | |
import { useButton } from "@react-aria/button"; | |
const ExampleButton: React.FC = () => { | |
const ref = useRef(); | |
const { buttonProps } = useButton({}, ref); | |
return ( | |
<div {...buttonProps} ref={ref}> | |
Click me | |
</div> | |
); | |
}; | |
document.addEventListener("DOMContentLoaded", () => { | |
render(<ExampleButton />, document.getElementById("app")); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "react-aria-example", | |
"private": true, | |
"version": "1.0.0", | |
"scripts": { | |
"start": "parcel index.html" | |
}, | |
"author": "Nick Hehr", | |
"license": "MIT", | |
"devDependencies": { | |
"@types/react": "^16.9.49", | |
"@types/react-dom": "^16.9.8", | |
"parcel-bundler": "^1.12.4", | |
"typescript": "^4.0.2" | |
}, | |
"dependencies": { | |
"@react-aria/button": "^3.2.1", | |
"react": "^16.13.1", | |
"react-dom": "^16.13.1" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"jsx": "react" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment