I'm trying to use emotion
.
My .js code is:
import React from 'react';
import { css } from '@emotion/core';
export const Menu = () => (
<>
<nav
css={css`
position: absolute;
color: white;
`}
>
<h1
css={css`
color: white;
`}
>
Title
</h1>
<ul>
<li>Proyectos</li>
<li>Blog</li>
<li>Acerca</li>
<li>Contacto</li>
</ul>
</nav>
</>
);
export default Menu;
When inspecting the element, I get this instead:
You have tried to stringify object returned from css
function. It isn't supposed to be used directly (e.g. as value of the className
prop), but rather handed to emotion so it can handle it (e.g. as value of css
prop).
@emotion/babel-preset-css-prop
(as documented in emotion.sh/docs/css-prop)?jsx
method since I didn't understood where to put those .babelrc or whatever file.