mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
feat: <PJAXLink />
This commit is contained in:
parent
1014eaff1c
commit
ad2c88b192
1 changed files with 9 additions and 0 deletions
9
src/components/PJAXLink.js
Normal file
9
src/components/PJAXLink.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import preact from 'preact'
|
||||
/** @jsx preact.h */
|
||||
import DOMHelper from '../utils/DOMHelper'
|
||||
|
||||
export default function PJAXLink({ to, children }) {
|
||||
return preact.cloneElement(children, {
|
||||
onClick: () => DOMHelper.loadWithPJAX(to),
|
||||
})
|
||||
}
|
||||
Loading…
Reference in a new issue