UNPKG
react-ally
Version:
latest (0.0.1-beta.2)
0.0.1-beta.2
0.0.1-beta.1
0.0.1-beta.0
Accessible react components
react-ally
/
src
/
sectioning
/
heading.js
9 lines
(7 loc)
•
246 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
import
React
, { forwardRef, useContext }
from
'react'
;
import
{
Level
}
from
'./level'
;
export
const
Heading
=
forwardRef
(
(
props, ref
) =>
{
const
level =
useContext
(
Level
);
const
Tag
=
`h
${level}
`
;
return
<
Tag
ref
=
{ref}
{
...props
} />
; });