Skip to content

Instantly share code, notes, and snippets.

@HipsterBrown
Last active September 3, 2020 17:06
Show Gist options
  • Save HipsterBrown/6480f7cc89afd083fb4aa827d6a89699 to your computer and use it in GitHub Desktop.
Save HipsterBrown/6480f7cc89afd083fb4aa827d6a89699 to your computer and use it in GitHub Desktop.
Minimal recreation of issue in `@react-aria/button` v3.2.1
<!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>
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"));
});
{
"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"
}
}
{
"compilerOptions": {
"jsx": "react"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment