Answer the question
In order to leave comments, you need to log in
How to connect your js script to a React.js component?
There is an Accordion component in which you need to connect a self-written js script.
I find only instructions for connecting libraries via npm.
import React, { Component } from 'react';
import './Accordion.css';
class Accordion extends Component {
render() {
return (
<aside className="accordion">
<h1>News</h1>
<div className="opened-for-codepen">
</div>
</aside>
);
}
}
export default Accordion;
Answer the question
In order to leave comments, you need to log in
Connect it in the same way as other files / components.
In this case, the file should have an export, like this:
const MathMax = (a, b) => {
return Math.max(a,b);
}
export default MathMax;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question