Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View config not found for name rect #106

Closed
mahdidavoodi7 opened this issue Oct 6, 2018 · 9 comments
Closed

View config not found for name rect #106

mahdidavoodi7 opened this issue Oct 6, 2018 · 9 comments

Comments

@mahdidavoodi7
Copy link

What did I do?

I write this code and I expected to run properly
this is my code :

const MyLoader = props => (
  <ContentLoader
    height={130}
    width={400}
    speed={2}
    primaryColor="#f3f3f3"
    secondaryColor="#ecebeb"
    {...props}
  >
    <rect x="19" y="45" rx="3" ry="3" width="245" height="5" /> 
    <circle cx="333.5" cy="78.76" r="49.5" /> 
    <rect x="19" y="75" rx="3" ry="3" width="245" height="5" /> 
    <rect x="19" y="105" rx="3" ry="3" width="245" height="5" />
  </ContentLoader>
)

render() {
  return(
      <MyLoader/>
  )
}

And i got this error

Invariant Violation: Invariant Violation: Invariant Violation: Invariant Violation: View config not found fot name rect

I used the last version of this library

@danilowoz
Copy link
Owner

Hey @mahdidavoodi7
Have you put the render method into a class component? Because as you wrote the code it's supposed to not work.

Take a look your code working using a dumb component:
https://codesandbox.io/s/5x39pv1v7k

And using a class component:
https://codesandbox.io/s/8n27qqr19j

Can you see and understand the difference?

@arkolesen
Copy link

HI, @danilowoz!
Seems, I've got similar trouble
but with title. As i see from updates (~6 days ago) - title Tag was added.
View config not found for name title.
I've deeped into sources and removed everything related to rendering title.
Than i got fail on circle tag..
What could it be?

Thanks, Regards

@danilowoz
Copy link
Owner

Hey @arkolesen
Could you please send an example of how you did the component?

Thanks

@FuriioS
Copy link

FuriioS commented Jan 6, 2019

Same here!

Invariant Violation: View config not found for name title


...
import { Facebook, Instagram } from 'react-content-loader'
const MyFacebookLoader = () => <Facebook />

export default class Shopping extends Component {
    render() {
        return (
            <ScrollView style={styles.container}>
                <MyFacebookLoader />
            </ScrollView>
        );
    }
}

@danilowoz
Copy link
Owner

@FuriioS Is it React Native?

@arkolesen
Copy link

@danilowoz Hi!
Sorry for delayed response - I was on vacation.

I resolved my needs via react-native-svg
So, unfortunately, I don't have that code (it wasn't commited). But As I remember, I tried example from repo:

const MyLoader = () => (
  <ContentLoader height={140} speed={1} primaryColor={'#333'} secondaryColor={'#999'}>
    {/* Pure SVG */}
    <rect x="0" y="0" rx="5" ry="5" width="70" height="70" />
    <rect x="80" y="17" rx="4" ry="4" width="300" height="13" />
    <rect x="80" y="40" rx="3" ry="3" width="250" height="10" />
  </ContentLoader>
)

If I will have time today/tomorrow - I can try again and write to you

Thanks a lot!

@danilowoz
Copy link
Owner

But I just would like to remember you guys that this is a package to React Web, not to React Native.
For RN you can check here or if you have a way to use this package in React Native, please let me know, maybe there are more people want to know this approach.

Thanks

@FuriioS
Copy link

FuriioS commented Jan 9, 2019

@FuriioS Is it React Native?

Yes. I thought the library was compatible :3

But I just would like to remember you guys that this is a package to React Web, not to React Native.
For RN you can check here or if you have a way to use this package in React Native, please let me know, maybe there are more people want to know this approach.

Thanks

Thank you for the quick response and the clarification : )

danilowoz added a commit that referenced this issue Aug 25, 2019
danilowoz added a commit that referenced this issue Sep 25, 2019
* feat(platform support): react native

re #148, re #137, re #106, re #89, re #16, re #6

* build(rollup): native bundle

* feat(native): stylized components

* build(typescript): react native check

* feat(typing): improves

* build(tsconfig): by environment

* test(web native): setup

* test(native): support

* docs(readme): native documentation
danilowoz added a commit that referenced this issue Sep 25, 2019
re #148, re #137, re #106, re #89, re #16, re #6

* build(rollup): native bundle

* feat(native): stylized components

* build(typescript): react native check

* feat(typing): improves

* build(tsconfig): by environment

* test(web native): setup

* test(native): support

* docs(readme): native documentation
@danilowoz
Copy link
Owner

🎉 This issue has been resolved in version 4.3.0 🎉

The release is available on:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants