Giter Site home page Giter Site logo

htmlelements / smart-webcomponents-react Goto Github PK

View Code? Open in Web Editor NEW
15.0 5.0 8.0 87.81 MB

Smart UI for React

Home Page: https://www.htmlelements.com/react/

JavaScript 34.44% TypeScript 0.24% CSS 57.46% PHP 0.01% SCSS 7.83% HTML 0.02%
react reactjs reactjs-components react-components react-component react-ui-components react-ui-framework react-ui react-material react-material-ui

smart-webcomponents-react's People

Contributors

bmarkov avatar svetoslavb04 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

smart-webcomponents-react's Issues

Error when importing DockLayout in tests

Hi guys,

I'm running into the following error and I was wondering if you could help:
I believe it's to do with module loading

 FAIL  src/App.test.tsx
  โ— Test suite failed to run

    TypeError: Cannot read property 'get' of undefined

      5 | import { ConnectedProps }                     from 'react-redux';
    > 6 | import { DockingLayout }                      from 'smart-webcomponents-react/dockinglayout';

      at Function.value (node_modules/smart-webcomponents-react/source/modules/smart.dockinglayout.js:8:82036)
      at window.<computed> (node_modules/smart-webcomponents-react/source/modules/smart.dockinglayout.js:8:90250)
      at node_modules/smart-webcomponents-react/source/modules/smart.dockinglayout.js:8:100825
      at Object.39 (node_modules/smart-webcomponents-react/source/modules/smart.dockinglayout.js:8:119277)
      at i (node_modules/smart-webcomponents-react/source/modules/smart.dockinglayout.js:8:4618)
      at node_modules/smart-webcomponents-react/source/modules/smart.dockinglayout.js:8:5406
      at Object.0 (node_modules/smart-webcomponents-react/source/modules/smart.dockinglayout.js:8:5416)
      at i (node_modules/smart-webcomponents-react/source/modules/smart.dockinglayout.js:8:113)
      at Module.115 (node_modules/smart-webcomponents-react/source/modules/smart.dockinglayout.js:8:133448)
      at i (node_modules/smart-webcomponents-react/source/modules/smart.dockinglayout.js:8:113)
      at node_modules/smart-webcomponents-react/source/modules/smart.dockinglayout.js:8:905
      at Object.<anonymous> (node_modules/smart-webcomponents-react/source/modules/smart.dockinglayout.js:8:916)
      at Object.<anonymous> (node_modules/smart-webcomponents-react/dockinglayout/dockinglayout.umd.js:2:1)
      at Object.<anonymous> (src/components/container_body/bodyContainer.tsx:6:1)
      at Object.<anonymous> (src/pages/container_main/mainContainer.tsx:7:1)
      at Object.<anonymous> (src/routes/routes.tsx:5:1)
      at Object.<anonymous> (src/App.tsx:7:1)
      at Object.<anonymous> (src/App.test.tsx:3:1)

Reproduce:

Issue by using this package with Vite React Typescript.

Hi,
When using this package in CRA (Create React App) it works as expected but when used with Vite it works in dev mode but it is not working when compiled.

Project compiles but then, it shows an error like this in console.

TypeError: e1.nativeElement.whenRendered is not a function
    at AccordionItem.componentDidRender
Smart$1.Render is not a function
    at Accordion.componentDidRender
e1.nativeElement.whenRendered is not a function
    at AccordionItem.componentDidRender

Could you find a solution for this? I tried several "fixes" but it didn't work
We have license and we are currently using SmartHtmlElements in vanilla projects.

Vite version: 2.9.5
React version: 18.0,0
Smart-webcomponents-react version: 15.0.3

Reproduced in a clean project made with Vite in last version. (Vite + React + Typescript basic project)
Thanks.

Error in Grid component

Hi, i encountered an error while trying to print a grid component in React (18.0.0).

image

Steps to reproduce:

I tried changing props and it keeps showing the error.

Thanks.

Issue with using React.createRef with DockingLayout

Hi,

I've been running into a weird issue where Typescript is complaining about my ref usage.

Reproduction code:

// class attribute
private dockinglayout = React.createRef<DockingLayout>();
// in render() method
<DockingLayout ref={this.dockinglayout} id="layout" layout={this.layout} draggable></DockingLayout>

Error is:

Type 'RefObject<DockingLayout>' is not assignable to type 'string | (string & ((instance: Element | null) => void)) | (string & RefObject<Element>) | (RefObject<DockingLayout> & string) | ... 6 more ... | undefined'.
  Type 'RefObject<DockingLayout>' is not assignable to type '((instance: DockingLayout | null) => void) & RefObject<Element>'.
    Type 'RefObject<DockingLayout>' is not assignable to type '(instance: DockingLayout | null) => void'.
      Type 'RefObject<DockingLayout>' provides no match for the signature '(instance: DockingLayout | null): void'.ts(2322)
index.d.ts(143, 9): The expected type comes from property 'ref' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<DockingLayout> & Readonly<HTMLProps<Element> & DockingLayoutProps> & Readonly<...>'

I think the problem lies in the following line in dockinglayout.d.ts

export declare class DockingLayout extends React.Component<React.HTMLProps<Element> & DockingLayoutProps, any> {

When I update the line to use React.HTMLAttributes instead of HTMLProps the error dissapears:

export declare class DockingLayout extends React.Component<React.HTMLAttributes<Element> & DockingLayoutProps, any> {

Some extra googling links:
https://stackoverflow.com/questions/50627493/how-extend-react-types-to-support-html-attributes-as-props
https://gist.github.com/mfal/88fe927f2061d22425cc78fcec8d260f

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.