mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Reactionary is just a tiny helper library that can rely on the react installed by the requiring application instead.
18 lines
451 B
CoffeeScript
18 lines
451 B
CoffeeScript
React = require 'react'
|
|
{div} = require 'reactionary'
|
|
SubscriberMixin = require './subscriber-mixin'
|
|
|
|
module.exports =
|
|
CursorComponent = React.createClass
|
|
mixins: [SubscriberMixin]
|
|
|
|
render: ->
|
|
{top, left, height, width} = @props.cursor.getPixelRect()
|
|
div className: 'cursor', style: {top, left, height, width}
|
|
|
|
componentDidMount: ->
|
|
@subscribe @props.cursor, 'moved', => @forceUpdate()
|
|
|
|
componentWillUnmount: ->
|
|
@unsubscribe()
|