diff options
| author | Stanley Yip <33562077+yipstanley@users.noreply.github.com> | 2019-11-16 14:34:33 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-16 14:34:33 -0500 |
| commit | 2231fc61a0a667c207ec3ca7156f7545cf909d17 (patch) | |
| tree | c3ef95f57ff84c847aedd0125173b6c58cbeb239 /src/client/views/DocComponent.tsx | |
| parent | 22d1e65236bae11c508d5c34ebcbddd1a552bfd8 (diff) | |
| parent | 68c9c230b3c98ec70adaa1dacb66215f09d2c1f6 (diff) | |
Merge pull request #302 from browngraphicslab/interaction_stanley
Interaction Improvements
Diffstat (limited to 'src/client/views/DocComponent.tsx')
| -rw-r--r-- | src/client/views/DocComponent.tsx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client/views/DocComponent.tsx b/src/client/views/DocComponent.tsx index 92c947fe6..b59bd4f1d 100644 --- a/src/client/views/DocComponent.tsx +++ b/src/client/views/DocComponent.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; import { Doc } from '../../new_fields/Doc'; +import { Touchable } from './Touchable'; import { computed, action } from 'mobx'; import { Cast } from '../../new_fields/Types'; import { listSpec } from '../../new_fields/Schema'; @@ -13,7 +14,7 @@ interface DocComponentProps { Document: Doc; } export function DocComponent<P extends DocComponentProps, T>(schemaCtor: (doc: Doc) => T) { - class Component extends React.Component<P> { + class Component extends Touchable<P> { //TODO This might be pretty inefficient if doc isn't observed, because computed doesn't cache then @computed get Document(): T { return schemaCtor(this.props.Document); } @computed get layoutDoc() { return PositionDocument(Doc.Layout(this.props.Document)); } |
