Code Monkey home page Code Monkey logo

Comments (5)

ljharb avatar ljharb commented on September 27, 2024 1

It's passed in as a prop by withStyles - check this.props.styles in InputForm.

from react-with-styles.

lencioni avatar lencioni commented on September 27, 2024 1

That page appears to be outdated. The readme is a better resource for you at this time https://github.com/airbnb/react-with-styles/blob/master/README.md

from react-with-styles.

khvr000 avatar khvr000 commented on September 27, 2024

My component is

import  React from "react";
import {css, withStyles} from "react-with-styles";

export class InputForm extends React.Component {

    constructor() {
        super()
    }

    render() {

        return (
                        <div className={"row"} style={{float:"left", clear:"both"}}>
                            <form  id="nameform">
                                First name: <input type="text" name="fname"></input>
                                Last name: <input type="text" name="lname"></input>
                            </form>
                                <button  {...css(styles.firstLink)} onClick={onClick}>Button</button>
                        </div>
        );
    }
}


export default withStyles(({ color }) => ({
    firstLink: {
        color: color.primary,
    },

    secondLink: {
        color: color.secondary,
    },
}))(InputForm);

from react-with-styles.

khvr000 avatar khvr000 commented on September 27, 2024

Where should I import or get the styles Object to use in my component .Please help me as I do want to change this functional component or forgive me if didnt understand the basics well @lencioni

from react-with-styles.

khvr000 avatar khvr000 commented on September 27, 2024

Thank you very much ! @ljharb I am trying to implement this article, but unable to find the ThemeProvider from 'react-with-styles' library , can you please help me with this ? @lencioni , Also cant find the registerDefaultTheme method on ThemedStyleSheet, Can we define our own provider to make the theme available in the whole app ?

from react-with-styles.

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.