Closed mblakele closed 9 years ago
I called the 'time' component directly. In:
(mozaik project folder)/node_modules/mozaik-ext-time/client.js
I changed the single line of code from:
module.exports = require('./lib/client');
to:
module.exports = require('./lib/components/Clock.js');
This does however generate a warning:
Warning: Something is calling a React component directly. Use a factory or JSX instead. See: http://fb.me/react-legacyfactory
Although the clock widget does appear to be working fine, does anybody know of any issues that may arise from calling this component directly?
Liam.
@mblakele I have to fix the generator to only require extension's client if it's available.
@ThrowingSpoon how do you instantiate the clock component ? When you use mozaïk, the widget is instantiated using this code https://github.com/plouc/mozaik/blob/master/src/browser/components/Widget.jsx#L18 If you're curious, you can read more about this here https://gist.github.com/sebmarkbage/ae327f2eda03bf165261
@mblakele I fixed the issue with extra client declaration, see https://github.com/plouc/mozaik-generator/commit/6480b100e696f2b31793561764683ceef2541e90 Feel free to re-open this issue if it does not fix the problem. (You'll have to update the yeoman generator)
Following the instructions at https://github.com/plouc/mozaik I used
yo mozaik
, which prompted me to select widgets. I selected the time widget, plus a few others. Howevernode app.js
produced an error:The problem seems to be this line that
yo mozaik
added to myapp.js
:However the time widget doesn't have a backend.
Workaround: comment out the line for
time/client
inapp.js
.