ajwann / svg-loaders-react Goto Github PK
View Code? Open in Web Editor NEWReact adaptation of the SVG Loaders library by Sam Herbert
Home Page: https://www.npmjs.com/package/svg-loaders-react
License: Other
React adaptation of the SVG Loaders library by Sam Herbert
Home Page: https://www.npmjs.com/package/svg-loaders-react
License: Other
Hello,
Thanks for creating this library!
I've tried all sorts of ways to re-size the svg, fontSize, width, height. Nothing seems to work. When I go here: https://samherbert.net/svg-loaders/
I can change the width directly on the "rings" svg and it just works. I'm trying to understand what this react layer is doing and why the size can't be controlled as easily. Any suggestions?
Thanks
The components aren't complex, so basic specs that test rendering are probably all that is needed.
https://www.npmjs.com/package/svg-loaders-react states latest publish was 2 months ago,
Latest PR ( which includes default classNames PR) was 4 days ago.
npm install
results in a version without default classNames, npm update
fails to detect a new minor release.
is this due to a missing bump of the package version in the package.json ?
should the test stage check for a change in the package.json version to ensure this won't happen again?
None of these components need to be class components, and all of them can be converted to functional components.
The CI server is passing, but each spec is logging a warning about an invalid prop type. This appears to be a problem with the test suite set-up, and not a poroblem with the actual
props being passed.
The error is
Warning: Failed prop type: Invalid prop `svg` of type `object` supplied to `SVGInline`, expected `string`.
in SVGInline
Based on this issue from enzyme
it looks like the issue can be fixed by adding the following moduleNameMapper to the
jest.config.js file:
moduleNameMapper: {
'\\.svg$': '<rootDir>/assets/mocks/svgMock.js',
}
Before version 1.0 a few things need to happen:
Each component no longer wraps an SVGInline
component. Thanks to @pandasa123 , each component renders a regular <svg>
tag.
That means that each component should be able to accept any/all SVG tag presentation attributes as props.
The section covering SVGInline options in the readme should be replaced with a section that covers and links to the available presentation attributes on MDN.
It would also be really nice to have a "Usage Examples" section that shows users how to make the most common configuration changes to a component, like changing the color, width or height, etc.
Once the readme is updated to show the new API changes, we can release version 2.0.0 (since these are technically breaking API changes).
It would be pretty sweet if all the components would come with a default className, this would allow us to handle svg customization from css on a global level instead of having to repeat the className everytime the spinner is used or the fill...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.