Port to React
See original GitHub issueCurrent workaround:
It’s not the best way, but if you want to use css-doodle
in React
you could try the following:
/* doodle.js */
import React from 'react';
import 'css-doodle';
export default ({ rule = '' }) => (
<css-doodle>{ rule }</css-doodle>
)
/* example.js */
import Doodle from './doodle';
<Doodle rule={`
:doodle {
@grid: 2 / 200px;
grid-gap: 1px;
}
background: @pick(red, pink);
`}/>
Better way:
Just use it directly!
import 'css-doodle';
function App() {
return (
<css-doodle>{`
:doodle {
@grid: 2 / 200px;
grid: 1px;
}
background: @pick(red, pink);
`}</css-doodle>
);
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:17
- Comments:11 (4 by maintainers)
Top Results From Across the Web
How to specify a port to run a create-react-app based project?
Under " \node_modules\react-scripts\scripts\start.js" , search for "DEFAULT_PORT" and add the desire port number. E.g : const DEFAULT_PORT = parseInt(process.
Read more >How to specify a port to run a create-react-app based project
When we create a new react app using the npx create-react-app command, the default port for the app is 3000. We can access...
Read more >Change the default Port for a create-react-app project
To change the default port for a create-react-app project, update the start command in your package.json file to specify the port, e.g. "PORT=3456 ......
Read more >ReactJS: Changing Default Port 3000 in create-react-app
The default port used by Express is 3000, the same default port used by ReactJS development server. Consequently, we need to resolve this...
Read more >A simple way to Change React App default port - Medium
The default port for react app is 3000 so your react app would normally run on localhost:3000 . Sometimes, I'm working on a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@papan01
I don’t know the support means, but I use
<css-doodle>
inDoodle.tsx
, and it works.First, you need to extend
JSX.IntrinsicElements
interface.And then, you can use
<css-doodle>
. (Unfortunately, it seems that there is no type definition yet.)hmm. Really nice 🥰
I think a template string helper would be nice too, similar to styled-components. Something like this: