rsnext/examples/with-babel-macros/pages/index.js

20 lines
363 B
JavaScript
Raw Normal View History

2017-07-14 23:22:25 +02:00
import React from 'react'
import preval from 'preval.macro'
const whoami = preval`
const userInfo = require('os').userInfo()
module.exports = userInfo.username
`
export default WhoAmI
function WhoAmI () {
return (
<div style={{ display: 'flex', justifyContent: 'center' }}>
2017-07-14 23:22:25 +02:00
<h1>
<pre>whoami: {whoami}</pre>
2017-07-14 23:22:25 +02:00
</h1>
</div>
)
}