You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Renaming a styled component does not always work from JSX #28065
Renaming a styled component from the JSX does not rename the styled component at its declaration.
Steps to Reproduce:
test.tsx:
importstyledfrom'styled-components';import*asReactfrom'react';constTest=styled.div` <---- renaming Test here successfully renames test below`;exportconstTesting:React.SFC=p=>{return(<div><Test>hi there</Test><-----renamingTestheredoesnotrenametestabove</div>
);
};
Does this issue occur when all extensions are disabled?: Yes
wow fast turnaround. i also noticed the original issue can be simplified to not include reference to styled components at all:
import * as React from 'react';
let S:React.ComponentClass; // <-- rename here changes both lines below
const e = <S/> // <-- rename here changes above
const e2 = <S></S> // <-- rename here does not change above
Activity
mjbvz commentedon Oct 22, 2018
Tested with TS 3.2.0-dev-20181020
The rename response does not include the component definition:
dontsave commentedon Oct 23, 2018
wow fast turnaround. i also noticed the original issue can be simplified to not include reference to styled components at all: