preact-compat | : raised_hands : React compatibility layer for Preact | Frontend Framework library

 by   preactjs JavaScript Version: 3.19.0 License: MIT

kandi X-RAY | preact-compat Summary

kandi X-RAY | preact-compat Summary

preact-compat is a JavaScript library typically used in User Interface, Frontend Framework, React applications. preact-compat has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

:raised_hands: React compatibility layer for Preact.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              preact-compat has a medium active ecosystem.
              It has 940 star(s) with 145 fork(s). There are 25 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 38 open issues and 199 have been closed. On average issues are closed in 520 days. There are 8 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of preact-compat is 3.19.0

            kandi-Quality Quality

              preact-compat has 0 bugs and 0 code smells.

            kandi-Security Security

              preact-compat has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              preact-compat code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              preact-compat is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              preact-compat releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed preact-compat and discovered the below as its top functions. This is intended to give you an instant insight into preact-compat implemented functionality, and help decide if they suit your requirements.
            • Create a component hook to a component instance
            • Handle props
            • Normalizes an event .
            • Replace a child component with a parent .
            • Clones an element .
            • Normalizes virtual nodes .
            • Create multiple hooks
            • Upgrade vnodes to vNodes
            • wrap stateless component
            • Sanitize virtual nodes
            Get all kandi verified functions for this library.

            preact-compat Key Features

            No Key Features are available at this moment for preact-compat.

            preact-compat Examples and Code Snippets

            No Code Snippets are available at this moment for preact-compat.

            Community Discussions

            QUESTION

            How to add react-router to preact app from preact-cli
            Asked 2021-Nov-29 at 14:43

            I created a Preact app using the preact-cli, and need to add react-router-dom to my project for routing. How can I add react-router to the project without ejecting the app, in order to install the router library?

            I've seen options for adding webpack, but that' requires ejecting the app.

            I added "preact-compat": "^3.19.0", to my package.json in the project, but not sure how to either add webpack or import the necessary react-router imports:

            import {BrowserRouter as Router, Route, Switch, NavLink} from 'react-router-dom';

            ...

            ANSWER

            Answered 2021-Nov-20 at 01:09

            but that' requires ejecting the app

            There is no way to "eject" from preact-cli. That isn't functionality that exists, so I'm a bit confused on what it is that you're referring to.

            We make the entire config available to you through your preact.config.js. With this, you can configure absolutely any part of the Webpack config that you'd like, and only those bits. You don't need to do anything like CRA's eject, where you have to now own the entire config yourself. You can edit the pieces you want, and leave everything else out of site & out of mind.

            I've seen options for adding webpack

            preact-cli uses Webpack for bundling, it's the fundamental underlying tool. There's no way to use it without Webpack, so this doesn't make much sense.

            I added "preact-compat": "^3.19.0"

            Remove this. preact-cli already adds compat, and does it from the correct source.

            If you read the docs for preact-compat, you'll see it's only for Preact 8.x and prior, which is a few years out-of-date at this point. The correct compat package for v10+ is preact/compat. We set this up for you already in preact-cli though, so nothing you need to do yourself.


            Why do you think you need to do any configuration just to import the library? Did you run into any errors, or maybe docs that are confusing/misworded? Just ran a test with v6, should work out-of-the-box after you swap it in for preact-router (assuming you've set up a preact-cli project using one of our templates)

            Source https://stackoverflow.com/questions/70039587

            QUESTION

            Aliasing react as preact throws Cannot find module: 'react/jsx-runtime'
            Asked 2021-Apr-06 at 16:08

            Dont use the guide I linked, it is old- use the one in the answer instead

            I am attempting to switch from react to preact by following their guide. I change webpack.config.js alias to add:

            ...

            ANSWER

            Answered 2021-Apr-06 at 06:07

            It looks like you were referring to a dated documentation page. Here is the latest one.

            Your should use preact/compat instead:

            Source https://stackoverflow.com/questions/66963248

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install preact-compat

            You need to install preact-compat first through npm:.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/preactjs/preact-compat.git

          • CLI

            gh repo clone preactjs/preact-compat

          • sshUrl

            git@github.com:preactjs/preact-compat.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link