Giter Site home page Giter Site logo

Comments (9)

ngokevin avatar ngokevin commented on May 11, 2024

I don't recommend using primitives with aframe-react, you can use the basic Entity building block. React already has component/wrapping logic.

<Entity text={{ text: 'hello' }}>

or maybe wrap it if you want like <Text/>

export default props => <Entity text={...props.text} material={...props.material}>

from aframe-react.

ngokevin avatar ngokevin commented on May 11, 2024

Because the whole premise of aframe-react is to expose the <Entity/> building block :)

Else you'd just use raw React

from aframe-react.

ngokevin avatar ngokevin commented on May 11, 2024

btw hoping to move that component into the aframe repo some time :)

from aframe-react.

alexwasner avatar alexwasner commented on May 11, 2024

So just for clarification, you are saying I should build my own component instead of attempting to use your aframe-text-component? I'm just trying to render some text onto the canvas.

Thanks for being so quick to respond.

from aframe-react.

ngokevin avatar ngokevin commented on May 11, 2024

You can use the component. I recommend not using primitives like <a-cube> or <a-sphere> since React kind of solves creating components.

You can use the text component. Do <Entity text={{ ...textProps }}>

from aframe-react.

ngokevin avatar ngokevin commented on May 11, 2024

Kind of confusing because of the overloading name of components :/

from aframe-react.

alexwasner avatar alexwasner commented on May 11, 2024

Hmm getting Unknown component attribute: text. Maybe its just a require issue. Thanks for the clarification on primatives.

from aframe-react.

ngokevin avatar ngokevin commented on May 11, 2024

Np, happy to debug any code you have here.

from aframe-react.

alexwasner avatar alexwasner commented on May 11, 2024

Ah, your demo has
var AFrame = require('aframe-core'); var textComponent = require('aframe-text-component'); AFrame.registerComponent('text', textComponent);
instead of

var textComponent = require('aframe-text-component').component;

from aframe-react.

Related Issues (20)

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.