score:3
It boils down to how you want to do JavaScript interop... you have 3 choices:
- Include the js from your HTML file
- Build it as part of your compilation
- Include it as a library
I encourage you to try (3); it isn't difficult, just follow the steps on CLJSJS https://github.com/cljsjs/packages/wiki/Creating-Packages
score:0
Use ClojureScript's compiler options to include the external JS in the build, then use reagent's adapt-react-class
to use the component in your reagent views. Try not to depend on projects like CLJSJS.
Doing this yourself will keep you in control of your project.
in project.clj
:foreign-libs [{:file "https://rawgit.com/felixrieseberg/React-Spreadsheet-Component/master/dist/spreadsheet.js"
:provides ["no-idea"]}]
in the views
(def reactable-table (r/adapt-react-class js/Reactable.Table))
(defn example []
[:div
[reactable-table
{:data (clj->js [
{:name "Foo" :section 51}
{:name "Bar" :section 51}])}]])
Note however that this component bundles lots of dependencies (jQuery). You might be better of by making a component like this yourself, in clojurescript/reagent.
Source: stackoverflow.com
Related Query
- How to prepare a React.js component for usage in ClojureScript as an external Reagent component?
- React & Jest: How to write a test for a component that depends on external function
- How to get rid of underline for Link component of React Router?
- How to test style for a React component attribute with Enzyme
- Figuring out how to mock the window size changing for a react component test
- How to use an array as option for react select component
- React & Jest, how to test changing state and checking for another component
- How to specify function parameters for React component callback with TypeScript?
- How to get code completion for typed react component properties?
- How to over-ride an @media css for a material-ui react component
- How to export Component for server side rendering in React
- How can I write a unit test for a react component that calls reduxjs's mapStateToProps?
- How to implement a React infinite scroll component for a chat app like Facebook Messenger?
- How can I search for a component with specific key in React Developer Tools?
- How to wait for complete render of React component in Mocha using Enzyme?
- How to define defaultProps for a stateless react component in typescript?
- How to bind "this" for react component method
- How can I test css properties for a React component using react-testing-library?
- How to conditionally render a DIV and REACT component for OPENING and CLOSING tags?
- React : How to stop re-rendering component or making an API calls on router change for the same route
- How to wait for a Redux action to change state from a React component
- How can I initialize Redux state for React component on its creation?
- How to make svg react component imports from external module working with create-react-app?
- how can I create a react component for paypal in-context express checkout?
- How to resove label overlapping issue for React Material UI auto complete component
- React setState callback not called for external (npm packaged) component
- Wait for external script to load before the React component
- How to create a React component for a bootstrap alert?
- How to properly declare type for React wrapper component (HOC) using Typescript
- How to make React component wait for redux store variables to get set?
More Query from same tag
- Change class of dynamically generated components in REACT without manually creating a separate state for each?
- Error - Actions must be plain objects. Use custom middleware for async actions
- Cannot install react-paypal-button-v2
- How to map components and ensure the component has the same attribute individually
- react-google-maps how does one get marker position?
- link postback in reactJS and dotnet core using ant design
- Test React component method with setInterval
- Installing React-Redux causes the chokidar Problem
- Scrollable part of page
- Best way to get HTTP data and handle a 404?
- too many request on react using axios on get api
- How do I keep correct indexing while dynamically rendering React components?
- Getting data to be fetched upon page render ReactJS
- Missing closing parenthesis in kendo React
- How to pass props to routes using redirect
- Mutating redux states between dispatches
- How to Call Function Before Link Element's onClick fires | Next.js
- ReactJS Expected corresponding JSX closing tag for <li>
- Syntax Error - Map multidimensional array in React-Redux
- Reactjs - parent, child action and functions
- tailwindcss, transform doesn't work but it does when added in css
- TypeError: classes are undefined ReactComponent. Material-kit-react
- how to cancel previous axios with redux in react
- How to use Django's session authentication with Django Channels?
- signInSuccessWithAuthResult return value in Firebase UI callbacks
- Reading json with axios and react
- How do I get the offset coordinates of a container in react.js?
- I am trying to use rowEvents to trigger an action in react-bootstrap-table-2 but 'this' in the onClick is undefined. Any ideas?
- Array been cleared
- Why is create-react-app's build directory in .gitignore?