Flipboard / Flipboard/react-canvas

I'm getting a ref error when I try to create a Surface.

Open
#82 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
13.2k
Forks
909
PR merge metrics
No merged PRs in 30d

Description

This is the console error:

```
Uncaught Error: Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. This usually means that you're trying to add a ref to a component that doesn't have an owner (that is, was not created inside of another component's `render` method). Try rendering this component inside of a new top-level component which will hold the ref.
```

Here's my code:

```
'use strict';

var React = require('react');
var $ = require('jquery');
var ReactCanvas = require('react-canvas');
var Surface = ReactCanvas.Surface;
var Image = ReactCanvas.Image;
var Text = ReactCanvas.Text;

var DropGame = React.createClass({

render: function() {

return (



Here is some text below an image.


);

}
});

module.exports = DropGame;
```

Is there something I'm missing?
Thanks in advance for the help!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.