Code Monkey home page Code Monkey logo

react-undraw's Introduction

Hello, I'm Justin ๐Ÿ‘‹

react-undraw's People

Contributors

andreimc avatar fnowacki avatar justinlettau avatar marklawlor avatar renovate-bot avatar renovate[bot] avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

react-undraw's Issues

Can't execute react-undraw-cli

Type

What kind of issue is this?

[x] Bug report.
[ ] Feature request.

Current Behavior

Can't execute react-undraw-cli

I have manually write path to .bin folder

Steps to Reproduce

Install current version using yarn on Debian OS

Command failed: tsc -p ./tsconfig.json Unhandled promise rejection

Type

What kind of issue is this?

[x] Bug report.
[ ] Feature request.

Current Behavior

The react-undraw-cli throw this:

(node:5996) UnhandledPromiseRejectionWarning: Error: Command failed: tsc -p ./tsconfig.json
(node:7172) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

Catching that error and logging it, the correct error was:

src/undraw/Undraw.test.tsx(2,22): error TS7016: Could not find a declaration file for module 'react-dom'. '<myproject>/node_modules/react-dom/index.js' implicitly has an 'any' type.\r\n Try npm install @types/react-dom if it exists or add a new declaration (.d.ts) file containing declare module \'react-dom\';\r\nsrc/undraw/Undraw.test.tsx(6,1): error TS2582: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try npm i @types/jest or npm i @types/mocha.

Expected behavior

At this point, it should generate the components,

Steps to Reproduce

  • mkdir react-undraw-issue
  • cd react-undraw-issue
  • npm i [email protected] (the error appears here too)
  • add "undraw": "react-undraw-cli", in scripts of package.json
  • npm run undraw

Other Information

After installing those @types/... in _phantomChildren field of package.json of your project, it creates the components as should.
EDIT: idk any more what I did to make it work

Add style and className props

Hello,

Type

What kind of issue is this?

[ ] Bug report.
[x] Feature request.

I'd like to apply extra styles to the svg illustration but there is no way to pass a className or style prop.

Is it possible to add them?

primaryColor prop only works when downloading using default color

Type

What kind of issue is this?

  • Bug report.
  • Feature request.

Current Behavior

When using an SVG downloaded with a different color besides the default unDraw color (#6C63FF), the primaryColor prop doesn't work.

Expected behavior

The primaryColor prop should replace whatever color was in the original SVG file.

Steps to Reproduce

  • Change the color on unDraw before downloading
  • Place in the /undraw folder
  • Run npm install and npm build
  • Insert the Undraw component and add a primaryColor prop

Other Information

It looks like the problem is in build.js where it replaces the SVG attributes based on the default unDraw hex code. Haven't looked into this yet but a possible fix could be first finding the hex code that is in the same location as the default hex code, then using that in replaceAttrValues.

Emit non es6 bundle alongside es6 bundle

Type

What kind of issue is this?

  • Bug report.
  • Feature request.

Current Behavior

Currently, only an es6 bundle is exported. Would be nice if there could also be a non es6 bundle that would play nicer when using this in environments that are not ready for es6 without having to compile this specific module.

Imported SVG are not rendering.

BUG

[x] Bug report.
[] Feature request.

Current Behavior

I Downloaded the svg file from undraw repo website, created a folder called undraw in the project root, renamed the svg to remove the suffix, prefix, and tried to render the svg with

 <Undraw
   name="signin"
 />

i've put the "react-undraw-cli" in start and build scripts.
The svg is not rendering., nothing happens.

Expected behavior

SVG being rendered.

Steps to Reproduce

  • Download the SVG that i've tried from Undraw
  • Create a folder inside the project root called undraw, and paste the file in there.
  • Try to render it with the undraw component.

Other Information

One fact is that i've tried to run yarn react-undraw-cli, but it seems that the cli command is not working.

  • React version: 16.13.1
  • Using typescript 3.7.2

The project structure:
image

Pieces of code:

  • The component that i've trying to render the undraw svg
const Signin: React.FC = () => {
    return (
        <div>
            <Undraw
                name="test"
            />
        </div>
    );
}
  • My Scripts:
  "scripts": {
    "start": "react-scripts start && react-undraw-cli",
    "build": "react-scripts build && react-undraw-cli",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "prebuild": "react-undraw-cli"
  },

The repo is actually public, that's an open source project, you can also check there if want to.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency husky to v8
  • chore(deps): update react monorepo to v18 (major) (react, react-dom)
  • fix(deps): update dependency @types/node to v18
  • fix(deps): update dependency @types/react to v18
  • fix(deps): update dependency @types/react-dom to v18
  • fix(deps): update dependency del to v7
  • fix(deps): update dependency glob to v8
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v3
npm
package.json
  • @svgr/core ^5.3.0
  • @svgr/plugin-jsx ^5.3.0
  • @svgr/plugin-prettier ^5.3.0
  • @svgr/plugin-svgo ^5.3.0
  • @types/jest ^25.1.4
  • @types/node ^12.12.32
  • @types/react ^16.9.27
  • @types/react-dom ^16.9.5
  • app-root-path ^3.0.0
  • del ^5.1.0
  • fs-extra ^9.0.0
  • glob ^7.1.6
  • pascal-case ^3.1.1
  • prop-types ^15.7.2
  • husky ^4.2.3
  • jest ^25.2.4
  • prettier ^2.0.2
  • pretty-quick ^2.0.1
  • react ^16.13.1
  • react-dom ^16.13.1
  • standard-version ^7.1.0
  • ts-jest ^25.2.1
  • tslint ^6.1.0
  • tslint-config-prettier ^1.18.0
  • tslint-react ^4.2.0
  • typescript ^3.8.3
  • react ^16.5.2
  • react-dom ^16.5.2

  • Check this box to trigger a request for Renovate to run again on this repository

Uncaught Error: Cannot find module "react-undraw"

Type

What kind of issue is this?

[x] Bug report.
[ ] Feature request.

Current Behavior

Added import Undraw from 'react-undraw' to a page and i get the error.

Expected behavior

Module error should not occur given that react-undraw is on package.json.

Steps to Reproduce

npm install react-undraw

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.