Conversation
…to feature/checkBoxFunctionality # Conflicts: # src/App.js
…ed again it does not take it back into original colour
| let pathArrayLocal = []; | ||
| let elementIds = []; | ||
| wrapElements(SVG_TAG_NAMES, array, pathArrayLocal, 7, elementIds); | ||
| let functionStr = |
There was a problem hiding this comment.
rather inject this function directly into the SVG than inject it to the DOM and then inject it to the svg file
There was a problem hiding this comment.
I cant actually , figure out how to inject it directly into svg, as with the options I tried its either element id is undefined or cant find the function its self, and when use elem.setAttribute('onClick', function(){ // code here });
with the above approach its expose my code in the element and does nothing after all.
| export const immutablePush=(arr, newEntry)=>{ | ||
| return [].concat(arr, newEntry) | ||
| } |
There was a problem hiding this comment.
if you wish to push to an array immutable you could also just say [...arr, newEntry] this will spread your existing array into a new one and add in the new entry to it
There was a problem hiding this comment.
I like the approach that you have mentioned, but I am no longer using this function as its have been removed from function.js file and I will you this approach in future. thanks
| if (indexOf < 0) { | ||
| this.props.updateStore("svgOptions",this.props.svgOptions.concat(this.props.value)) | ||
| } else { | ||
| this.props.updateStore("svgOptions",this.props.svgOptions.slice(0,indexOf).concat(this.props.svgOptions.slice(indexOf + 1)) |
There was a problem hiding this comment.
so for this, for readability sake, i would say
`
let { svgOptions=[] } = this.props;
let updatedArr = indexOf < 0
? [...svgOptions, this.props.value ]
: [...svgOptions.slice(0, indexOf), ...svgOptions.slice(indexOf+1)];
this.props.updateStore("svgOptions", updatedArr );
`
There was a problem hiding this comment.
Thanks, I have used spread for more readability
There was a problem hiding this comment.
let { svgOptions=[] } = this.props; what does this line do ? what format is this, does this also fall under spread concept.
| render() { | ||
| for (var key in CardLayout) { | ||
| if (CardLayout[key].type === "checkbox") { | ||
| this.state.settingOptionList.push( |
There was a problem hiding this comment.
this is not how state is local state should be mutated, please make use of setState.
There was a problem hiding this comment.
While I was clearing console, I removed this loop altogether its was causing warnings regarding key duplication. components with the same key value
| /> | ||
| ); | ||
| } else if (CardLayout[key].type === "slider") { | ||
| this.state.settingOptionList.push( |
There was a problem hiding this comment.
this is not how state is local state should be mutated, please make use of setState.
There was a problem hiding this comment.
While I was clearing console, I removed this loop altogether its was causing warnings regarding key duplication. components with the same key value
Does display, hover , change colour and download them.