-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use dTree in ReactJS? #108
Comments
For react import React, { useEffect } from 'react' function DTree({ treeData,onNode }) { const tree = React.createRef() useEffect(()=>{ "+ "
""+ " " + name + "
},[]) ) } export default DTree |
var _ = require('lodash') function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } (function (global, factory) { var TreeBuilder = (function () {
})(); var dTree = {
}; return dTree; |
Simple, minimalist solution that separates concerns: //in src/App.js
}, []); ); } export default FamTree; THEN //in your public/index.html add this: <script src="https://d3js.org/d3.v4.min.js"></script> <script src="https://cdn.jsdelivr.net/lodash/4.17.4/lodash.min.js"></script> <style> body { font: 10px sans-serif; } .linage { fill: none; stroke: #000; }
.... rest of the React defaults here Tested - works. |
Hello, can you please advice, what to return in html? I followed your example, no errors, but no output of tree on page. Guess the component should return somethig like:
|
@noszone probably it's a bit late, but you should add useRef.
|
No description provided.
The text was updated successfully, but these errors were encountered: