Do any of you fine folks use quokka while developing React apps?
It looks awesome when you are writing isolated code, but I’m trying to run the PRO version with react – after following the instructions for projects that use create-react-app – and it has been disappointing to say the least – perhaps due to me being ignorant and missing something.
First, I can’t just run it against whatever file I’m working on. I have to create a separate file, import react-dom, and the render my component to the DOM.
Please correct me if I am misunderstanding something:
For a more complex app, I have to wrap my component with routers, providers… in other words, all the stuff my app parses before getting to that component.
If that component expects props, I have to provide those in my render statement (I can understand the reason for this… just making sure I’m getting this right):
import React from ‘react’;
import ReactDOM from ‘react-dom’;
import Component from ‘./Component’;
const propObject = {“foo”: 1, “Bar”:2}
const div = document.createElement(‘div’);
ReactDOM.render(<SomeWrapper><Component prop={propObject}/><SomeWrapper/>, div);
div.getElementsByClassName(‘SomeClass’)[0].innerHTML //?
Is that workflow correct?
If so, what’s the point if the actual code I want to use the extension for is encapsulated in ./Component?
submitted by /u/grudev
[link] [comments]